Results 1 to 2 of 2

Thread: How to invoke a form from a button click using Java Swing?

  1. #1
    Join Date
    Jul 2009
    Posts
    8

    Exclamation How to invoke a form from a button click using Java Swing?

    Hi...Plz help how to program such that when I click a button, it invokes another form using Java Swing...

  2. #2
    Join Date
    Jan 2006
    Posts
    211

    Re: How to invoke a form from a button click using Java Swing?

    You may use the following method in your program for the button click which will allow you to open the form on just a single click.

    public NewJFrame() {
    initComponents();
    jButton1.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    new NewJFrame1().setVisible(true);
    }
    });
    }

Similar Threads

  1. How to handle JButton Click Event in Java Swing
    By Kungfu Pandey in forum Software Development
    Replies: 3
    Last Post: 20-01-2012, 12:13 PM
  2. Print in java using Swing
    By Sheenas in forum Software Development
    Replies: 3
    Last Post: 18-11-2009, 09:50 AM
  3. drawPolygon in java Swing?
    By JagdishP in forum Software Development
    Replies: 3
    Last Post: 07-08-2009, 11:33 PM
  4. Message Box example for Java Swing
    By Visala28 in forum Software Development
    Replies: 3
    Last Post: 31-07-2009, 05:30 PM
  5. Java swing help with repaint()
    By grudge in forum Software Development
    Replies: 4
    Last Post: 23-07-2009, 03:41 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,586,345.37707 seconds with 17 queries