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 07-12-2008, 01:27 PM
Member
 
Join Date: Jul 2008
Location: CA
Posts: 15
obdi is on a distinguished road
[SOLVED] new2java- gettext settext
Code i wrote for ClickPlay is to get the first hand money input into the textfield by using InputDialog, i try to put it in the ClickPlay(), when i click start, it keeps poping up the dialog box, and not reading the number to the textfield, is something wrong with the code or i need to put it to somewhere else(which i tried to put it to different places) please help

Code:
CASHONHAND = JOptionPane.showInputDialog("Enter The Amount You Wish To Play"); cashonhand = Double.parseDouble(CashOnHandNum.getText()); CashOnHandNum.setText("" + cashonhand);

Code:
private class ClickPlay implements ActionListener { public void actionPerformed(ActionEvent e) { CASHONHAND = JOptionPane.showInputDialog("Enter The Amount You Wish To Play"); cashonhand = Double.parseDouble(CashOnHandNum.getText()); CashOnHandNum.setText("" + cashonhand); ActionListener Begin = new TimeStamp(); MyTimer = new Timer(35, Begin); MyTimer.start(); } private class TimeStamp implements ActionListener { public void actionPerformed(ActionEvent e) { Action++; if (Action < 20) { HideOne = RandomNumbers(); HideTwo = RandomNumbers(); HideTre = RandomNumbers(); NumberOne.setText("" + HideOne); NumberTwo.setText("" + HideTwo); NumberTre.setText("" + HideTre); } else { Action = 0; MyTimer.stop(); NumberOne.setText("*"); NumberTwo.setText("*"); NumberTre.setText("*"); } } } }
Code:
JTextField CashOnHandNum = new JTextField(); String CASHONHAND;

Last edited by obdi : 07-12-2008 at 01:31 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-12-2008, 06:17 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
For debugging you code, add some println() statements to it to show the values of variables as they are changing and to show control flow.

For example, what is the value of CASHONHAND on return from the JOptonPane call? You don't appear to do anything with it.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-13-2008, 10:28 AM
Member
 
Join Date: Jul 2008
Location: CA
Posts: 15
obdi is on a distinguished road
Quote:
Originally Posted by Norm View Post
For debugging you code, add some println() statements to it to show the values of variables as they are changing and to show control flow.

For example, what is the value of CASHONHAND on return from the JOptonPane call? You don't appear to do anything with it.
Thanks Norm,
Code:
CASHONHAND = JOptionPane.showInputDialog("Enter The Amount You Wish To Play"); cashonhand = Integer.parseInt(CASHONHAND); //cashonhand = Integer.parseInt(cashonhand.getText()); CashOnHandNum.setText("" + cashonhand);
so now i get value for CASHONHAND, here's my question. Why don't i need getText()? or when i use the .parse with String i don't need it? it's like a syntax?

Last edited by obdi : 07-13-2008 at 10:30 AM.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-18-2008, 07:57 AM
Member
 
Join Date: Jun 2008
Posts: 9
gustio is on a distinguished road
jScroolPane in JInternalFrame
Hey everybody,

- I make menu form(JForm) to access another form (this form use max resolution screen which computer run)
- From menu form, I load another form(JInternalFrame) into this form.
- another form have jScroolPane in JInternalFrame.

Process:
- When I run my program, scrool in another form can not functioned.

My question:
- How I must do for activating this scrool?
- I can use scrool with JDialog, but I can not using screen resolution for making display area. How I set display area JDialog?

Thank's a lot for your time.

Salam,
bagianto
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-21-2008, 11:28 AM
Member
 
Join Date: Jun 2008
Posts: 9
gustio is on a distinguished road
Sorry, I am new in this forum. Sorry with my post before.
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
setText in event sniezna.stopa SWT / JFace 0 06-20-2008 04:56 PM


All times are GMT +3. The time now is 02:14 AM.


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