Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.09 seconds.

  1. Replies
    9
    Views
    2,595

    Re: JButton events

    You could use an anonymous inner class, as stated above. Did you do any googling of that? Something like:

    ActionListener al = new ActionListener(){
    public void actionPerformed(ActionEvent e){...
  2. Replies
    9
    Views
    2,595

    Re: JButton events

    Well, that's not valid syntax, and that's not what I suggested. Recommended reading: Lesson: Writing Event Listeners (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    Edit- I see Sean4u...
  3. Replies
    9
    Views
    2,595

    Re: JButton events

    You don't need to extend JPanel, but you do need an instance (I'm assuming of ActionListener) to pass into the method. Do that by implementing ActionListener in a class you actually instantiate or by...
Results 1 to 3 of 3