Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help please  RSS feed

 
Mihai Lita
Ranch Hand
Posts: 36
Firefox Browser Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
I have a JComboBox wich holds 5 objects. And i have a button that generates tickets(bus tickets). How can i register a counter depending on wich JComboBox object is selected?

I can share code if needed.
Thanks
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseAMeaningfulSubjectLine instead of something like "help please". I'll move your question to the Swing forum.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the JComboBox API for methods which will let you find out which item is selected.
 
Mihai Lita
Ranch Hand
Posts: 36
Firefox Browser Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i have and object list i can use the getSelectedItem method.
I have 2 JComboBoxes , the first one selects a bus driver, the other ones selects the route of the bus. Depending on the route i have the price of the ticket.
I want to make a report of sales for each driver.
Any sugestions please?
 
Rob Spoor
Sheriff
Posts: 21044
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far?
 
Mihai Lita
Ranch Hand
Posts: 36
Firefox Browser Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have it all <3

http://tinyurl.com/4s6mjzb

It`s in my native tongue the interface, but it`s working as i planned.
Translation:
Sofer = Driver
Rute = Route
Pret = Price

Any ideas of how i can improve it?
 
Mohamed Sanaulla
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We would expect you to post the code where you are stuck.
 
Mihai Lita
Ranch Hand
Posts: 36
Firefox Browser Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, i already finished what i wanted.
You may close the topic.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't close (lock) topics when the problem is solved. Thanks for telling us that you've solved it.
 
Mihai Lita
Ranch Hand
Posts: 36
Firefox Browser Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should i post the code here or ... ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!