Skip to content

Tag: inner-classes

Java Swing unable to remove a component

I am trying to build a quiz game that rerender itself after user click on the button with answer. I have added an action listener to 4 buttons. When the button is clicked, it is suppose to reach the outer class which extend JFrame and remove the QuestionPanel that extends the JPanel. And then create a new Que…

Java Inner Classes

I’m new to Java and have the following question regarding inner classes: When implementing an inner class, do I need to declare its attributes and methods scope i.e. public, private, protected? EDIT: With the absence of delegates (as in C#) could someone mention how best to implement a messaging system …