• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Opening a new window.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:



 
Sheriff
Posts: 28362
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok nice one

Thanks for the help
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic