Solved

opening a pop-up JTextArea

Posted on 2004-04-28
2
418 Views
Last Modified: 2013-11-28
I have a java application with a button that connects to a database and retrieves some information.
When I click the button I want another window(a JTextArea with scrollPane) to pop-open seperately and display the information.

Does anyone have an idea how to do this?
I cant seem to find anything suitable on the web.

thanks.
0
Comment
Question by:credit
2 Comments
 
LVL 7

Accepted Solution

by:
maheshexp earned 250 total points
ID: 10940494
just place the new window invoking code in a action listener of the button u need to click
class OtherWindow extends JFrame{
           public OtherWindow(){
               /* codes */
              this.setSize(300,400);
              this.show();
           }
}

class CurrentWindowextends JFrame{

    public CurrentWindow(){
         JButton bt1 = new JButton("open");
          bt1.addActionListener( new ActionListener(){
                    public void actionPerformed(ActionEvent e){
                          /* code for the new Window to open */
                             new OtherWindow();
                   }
         });
   
          this.getContentPane().add(bt1);
        this.setSize(100,200);
           this.show();
    }

     public static void main(String[] args){
           new CurrentWindow();
     }
}
0
 

Author Comment

by:credit
ID: 10941154
That worked grand!

thanks maheshexp.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Every business owner understands the significance of online customer reviews and the impact it can have on sales and revenues. With technology advancing at such a rapid pace, getting online reviews has never been easier, especially when many regions…
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question