Solved

opening a pop-up JTextArea

Posted on 2004-04-28
2
404 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
endX challenge 2 48
XML Paring  Error - Premature end of file. 7 55
java set up 1 46
maven example error 3 35
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now