Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2007, 06:57 AM
bbq bbq is offline
Senior Member
 
Join Date: Jun 2007
Posts: 134
bbq is on a distinguished road
problems with jDialog in a JFrame
I have a JFrame in which when I click in JButton appears a JDialog.

The problem is that doesn’t do anything when I click register button
my code is:
Code:
public class recordpage extends JDialog{ private Container contain; private JLabel Nick, Pass, ConfimPass, Mail; private JTextField textNick, textMail; private JPasswordField textPass, textConfirmPass; private JButton register; public recordpage (){ super(); Container contain =getContentPane(); contain.setLayout(new FlowLayout()); JLabel Nick =new JLabel("Nick "); JLabel Pass =new JLabel ("password "); JLabel ConfimPass new JLabel ("Confirm your password"); JLabel Mail =new JLabel ("your email: "); JTextField textNick =new JTextField ("", 10); JPasswordField textPass =new JPasswordField("", 10); JPasswordField textConfirmPass=new JPasswordField("", 10); JTextField textMail =new JTextField("", 10); JButton register=new JButton ("Log in"); contain.add(Nick); contain.add(textNick); contain.add(Pass); contain.add(textPass); contain.add(ConfirmPass); contain.add(textConfirmPass); contain.add(Mail); contain.add(textMail); contain.add(register); this.setTitle("Register"); this.setModal(true); this.setLocation(200, 150); this.setSize(new Dimension(300, 180)); this.setVisible(true); registrar.addActionListener ( new ActionListener(){ public void actionPerformed(ActionEvent ae){ dispose(); } } ); } }
thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-05-2007, 06:14 AM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
You're declaring JButton 2 times. One as class attribute and other as local variable of the method
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to make a JDialog scrolling from one position to the other. Eranga AWT / Swing 1 03-28-2008 12:26 PM
help with jdialog leonard AWT / Swing 1 08-05-2007 07:37 AM
Close a JDialog Programmatically Marcus Advanced Java 1 07-06-2007 06:06 PM
Help with JFrame Albert AWT / Swing 2 07-04-2007 06:44 AM
How to get rid of minimize and close icon on a jdialog? sandor AWT / Swing 1 04-09-2007 02:05 AM


All times are GMT +3. The time now is 12:45 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org