Search:

Type: Posts; User: ChrisR

Search: Search took 0.11 seconds.

  1. Re: Let 'A' be an extension of JPanel, 'B' is a JPanel, and 'F' is a JFrame. Suppose B.add(A), and F.add(B). How do I access an ActionEvent, which occurs within 'A', from 'F'?

    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...
  2. Re: Let 'A' be an extension of JPanel, 'B' is a JPanel, and 'F' is a JFrame. Suppose B.add(A), and F.add(B). How do I access an ActionEvent, which occurs within 'A', from 'F'?

    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{
  3. Let 'A' be an extension of JPanel, 'B' is a JPanel, and 'F' is a JFrame. Suppose B.add(A), and F.add(B). How do I access an ActionEvent, which occurs within 'A', from 'F'?

    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,...
Results 1 to 3 of 5