• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening a new window.

 
Ian Locke
Greenhorn
Posts: 5
  • 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
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • 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
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok nice one

Thanks for the help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic