• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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:



 
Marshal
Posts: 28226
95
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic