Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
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 05-01-2008, 03:24 PM
Member
 
Join Date: May 2008
Posts: 10
Jay-1.1 is on a distinguished road
Java Question
I want to display a text field that shows the cost of a selected item or items how would I go about this?

In my code I have two text areas one with all the items and prices in and a blank text area. When I input a value into a text field it puts the selected item from the first text area into the second text area.

Any help would be appreciated.

Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-01-2008, 03:40 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 518
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Selected item? or matched item?

Just cut those matched item,
- have a copy of the content
- Remove that matched item
- Show the new content.

store in a temp variable,
- A String variable

append it to the 2nd textArea.

If you can post the content of your first textArea,
Much better......
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-01-2008, 03:47 PM
Member
 
Join Date: May 2008
Posts: 10
Jay-1.1 is on a distinguished road
When I enter a item number into a text field it brings up the item in the second text area.

private void makeItem() {
games[numberOfItems] = new Item("Ball", 39.99f);
numberOfItems++;
}

This is how I created the items I now want to get the 39.99f price out and put it into a separate text field. Also when I add more items I want it to add that to the total.

Thanks

Last edited by Jay-1.1 : 05-01-2008 at 03:49 PM.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-01-2008, 03:56 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 518
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Content, not code.....

(the text which appeared from your 1st textArea.)
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-01-2008, 03:59 PM
Member
 
Join Date: May 2008
Posts: 10
Jay-1.1 is on a distinguished road
All my code
Deleted code

Last edited by Jay-1.1 : 05-01-2008 at 04:15 PM.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-01-2008, 04:13 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 518
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
I guess the content of your textArea is like:

Quote:
Grand Theft Auto IV
39.99f

FIFA 2008
37.99f

Assassins Creed
39.99f

Formula One Chapionship Edition
25.00f

Pro Evolution Soccer 2008
24.99f

Euro 2008
39.99f

Football Manager 2008
19.99f
am i right?
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-01-2008, 04:20 PM
Member
 
Join Date: May 2008
Posts: 10
Jay-1.1 is on a distinguished road
I still dont get how to do a cost field my code already works like i want it to and was complete until i wanted to include a cost field. I just want to display the cost of the selected items in a cost field

Last edited by Jay-1.1 : 05-01-2008 at 04:26 PM.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-01-2008, 04:33 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 518
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
I doubt now....

@ first post, you're saying like
"transfer the matched text(based on textfield) from textArea1 to textArea2"

And now, you're just gonna display it? how?
I really don't understand you're problem.....

Quote:
I just want to display the cost of the selected items in a cost field
What is that cost field? textArea? List? or textfield?

You should be specific bro....

Im asking you if i am right at post #6.
Or, post that content like what i've guess @ #6
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 05-01-2008, 04:38 PM
Member
 
Join Date: May 2008
Posts: 10
Jay-1.1 is on a distinguished road
Yes the content of text area 1 is like that just without the f sorry didnt see that. Then when i select it, it copies the item from text area 1(Games) and puts it into text area 2 (games selected) and thats the one that i need to get the cost out of. To display in a NEW Cost text field that shows the cost which i have already created.

Thanks

Last edited by Jay-1.1 : 05-01-2008 at 04:49 PM.
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 05-01-2008, 04:51 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 518
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Quote:
Then when i select it
How did you select it? By highlighting it? or how?

After choosing that value for textArea1, what component did you use to trigger the value transfer?
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 05-01-2008, 04:54 PM
Member
 
Join Date: May 2008
Posts: 10
Jay-1.1 is on a distinguished road
I entered the number of the game and selected the submit game button that transfers it from games to selected games.

0.Grand Theft Auto IV (39.99)
1.Euro 2008 (39.99)
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 05-01-2008, 05:04 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 518
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Code:
games[numberOfGames] = new Game("Grand Theft Auto IV", 39.99f); numberOfGames++;
Base on the code you've posted,

It would be nice if you add those values on an array
Example:
gamename[x]
cost[x]....

eg: gamename[x] = name_of_the_game;
cost[x] = name_of_the_game_COST;

When you input a number, it should represents the gamename and cost right?

Try to access that cost[x] array to get the value...
And append to the second textArea.
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
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
Java Question, i need to be answered Sunshine New To Java 7 04-28-2008 02:00 PM
Quick Java question/help Zedy New To Java 6 04-22-2008 04:40 AM
A core java Question chravikumar008 New To Java 2 04-21-2008 09:04 AM
New Comer, Java C# question lmei007 Advanced Java 0 02-04-2008 05:54 PM
Java Review Question toad New To Java 1 10-29-2007 07:13 AM


All times are GMT +3. The time now is 06:48 AM.


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