6 Replies - 1737 Views - Last Post: 27 October 2009 - 09:57 AM Rate Topic: -----

#1 litterbug_kid   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 50
  • Joined: 29-January 08

Gui Help - Opening a second window

Post icon  Posted 24 October 2009 - 02:22 AM

In the first window I am entering info into text fields, from that window I want to be able to open a second window with a JTextArea displaying the information from the textboxes from the first window. I want to then be able to close the second window without closing the first window.
I've done the first window fine and started to do the second window in a second class, but I don't know how to open the second window from the first window in the new class.
Any help would be much appreciated. Thanks!

This post has been edited by litterbug_kid: 24 October 2009 - 02:22 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Gui Help - Opening a second window

#2 AbuJaFaR   User is offline

  • D.I.C Regular

Reputation: 13
  • View blog
  • Posts: 330
  • Joined: 13-December 07

Re: Gui Help - Opening a second window

Posted 24 October 2009 - 04:36 AM

Hello there.You can create a button in the first window which will trigger the event of a new window :)
Was This Post Helpful? 0
  • +
  • -

#3 fsloke   User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 413
  • Joined: 19-December 07

Re: Gui Help - Opening a second window

Posted 24 October 2009 - 05:34 AM

Since you said

Quote

I've done the first window fine and started to do the second window in a second class, but I don't know how to open the second window from the first window in the new class.


Please kindly post your code here.

We will help you to correct it...

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 Tshiknn   User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 20
  • Joined: 18-October 09

Re: Gui Help - Opening a second window

Posted 24 October 2009 - 07:35 AM

I won't give you any code, but I will give you this: How did you open your first window? You open your second window in the same way.
Was This Post Helpful? 0
  • +
  • -

#5 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Gui Help - Opening a second window

Posted 24 October 2009 - 03:59 PM

View Postlitterbug_kid, on 24 Oct, 2009 - 01:22 AM, said:

In the first window I am entering info into text fields, from that window I want to be able to open a second window with a JTextArea displaying the information from the textboxes from the first window. I want to then be able to close the second window without closing the first window.

This is why JOptionPane were invented for

http://java.sun.com/...OptionPane.html
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Gui Help - Opening a second window

Posted 24 October 2009 - 03:59 PM

Check out the JFrame class: http://java.sun.com/...ing/JFrame.html

Pay special attention to two methods that are inherited from the Window class- setVisible() and dispose(). Feel free to post any problems you may be encountering when using these methods as well as the corresponding code. Good luck! :)
Was This Post Helpful? 0
  • +
  • -

#7 litterbug_kid   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 50
  • Joined: 29-January 08

Re: Gui Help - Opening a second window

Posted 27 October 2009 - 09:57 AM

Thankyou for your help. I managed to do it by using a second class extending JFrame.
Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1