• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Pressing a button to open a new window

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i�m developing an application about a repair shop for automotive vehicles with a connection to a DB.
Waht i want to do is this :i have my button "New Client" and i�m trying to do that when i press the button , it opens a new window (i think it would be a new JFrame) where it will be the application form to fill it with the name,last name, address, telephone and so on but i don�t know what component i have to use.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could use either a JFrame or a JInternalFrame.
 
Ilh Oleo
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but how can i implement it??
what kind of method can i sue to open a window when i do click with the mouse over the button?? that is what i want to know
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
usually a JDialog is used, similar to a JFrame, but used modally,
meaning execution of the calling method is paused until the dialog closes,
and, if it's the way you want to do it, return the input data.
 
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you...

1) ...created and added a listener for your button?
2) ...created your new client window by using the new operator?
3) ...set your layout manager for your client window?
4) ...added the components to your new client window?
5) ...called setVisible(true) for your new client window? Do this last of all.
6) ...are you using more than a single thread? this requires extra care.

Kaydell
 
Ilh Oleo
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this

........more code above....



And this is what it should appear at clicking the button



But nothing appears, by the way it�s OK to post all that rude code? (i mean the part of the init components)
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic