This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening a new window.

 
Ian Locke
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

Im trying to get a new window to open once I click the Add Customer button in my first window, but I have no idea how to do it. Could someone point me in the right direction?

Cheers
Ian

Here's my code so far:



 
Paul Clapham
Sheriff
Pie
Posts: 20199
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A new "window"? Would that be a JDialog or a JFrame? You already know how to open a new JFrame, in fact you posted an example of that here. But you might well be better served by a JDialog to allow entry of customer information.
 
Ian Locke
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want it to be another JFrame but I cant get 2 JFrame's to work. When I click the button I need to enter the customers info and have some buttons to select what I want to do with this info.

Thanks
Ian
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the text of each button indicates the screen's of your other frames might be detailed.

if so, using a CardLayout() might be a good soution:
build each screen via a JPanel
add each panel to a cardLayoutPanel
add the cardLayoutPanel to a frame

each button's actionPerformed simply shows the relative screen
 
Ian Locke
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok nice one

Thanks for the help
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic