It's improper because the first class, Special_JPanel, has a field which is left as public. --And, this is done so that the first class can access the JComboBox, jCB, for the sake of 'hearing' its...
Type: Posts; User: ChrisR
It's improper because the first class, Special_JPanel, has a field which is left as public. --And, this is done so that the first class can access the JComboBox, jCB, for the sake of 'hearing' its...
Here's code that uses the current (improper) solution:
import javax.swing.JPanel;
import javax.swing.JComboBox;
import java.awt.Dimension;
public class Special_JPanel extends JPanel{
Hi there!
Here's the scenario:
+ Suppose we have a class GUI which extends JFrame and implements ActionListener.
+ We define a class Special_JPanel which extends JPanel.
+ A JComboBox,...