• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jcomboboxes linked to textarea displays

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's what I'm trying to do;

I have 4 jcombobox's that need to contain several letters each, when a letter is selected it will display the corresponding text in one of four jtextarea's

I am very new to this, I can generally modify existing code but have never really started from scratch, I got as far as creating the containers and controls but I am stumped as to how to get the comboboxes to work and data to display in the text areas

This code is what I have so far, I am using NetBeans IDE 6.5.1, a screenshot of the interface is included.


Thanks

This is what it looks like in the IDE



I have it working as an excel spreadsheet, it looks like this;



updated code (3/29/09 9:45am)



 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Use Code Tags. You can use the Edit button to update your post.
 
Max Lipshitz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a little further along, I have the correct selections in the combobox's now. I still need to display text in the ScrollPane / TextArea's that correspond to the selection in the corresponding combobox.

For example, looking at the excel screenshot, the letters in the yellow boxes correspond to the text that is in the 4 boxes below the letters, in the 1st yellow box is the letter "D". In the data fields below, the "D" corresponds to "Duct PIC" so "Duct PIC" is displayed in the chart next to "cable design". This is what I am trying to do.

I need to know where in the code to put the data that is to be looked up and displayed when a value is chosen in the drop down combobox and how to link the combobox to the Scrollpane/TextArea so that the text associated with the combobox choice is displayed in it.

I also updated the code above to reflect the choices in the comboboxes
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here's a simple demo of what I think you're trying to do



note:
generally, posting netbeans-generated code is a waste of time.
few, if any, will read it, and unless using netbeans, it cant' be copied into other ide's and run 'as-is'

if you have a problem with a component, don't post all your code, create another program and strip
it down to the problem component, similar to above code i.e. just enough code that can be compiled
and the problem seen.
 
Max Lipshitz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael, yes, that is very similar to what I am looking for, applying this to the code I already have, can you point out which section looks for the letter chosen in the dropdown box and which section outputs the text to the text box? Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the method that handles both, and the message says it all

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Max Tech", please check your private messages for an important administrative matter.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic