• 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

display data from a JComboBox from one JFrame to another

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have two windows, one where the user selected an element in a JComboBox and the other where I want to retrieve the value of this JComboBox and display it in a label.
The problem is: how to retrieve the value of the text in the JComboBox and send it to my second window?

I have two class in the same package :


fenetre1.java





fenetre2.java




it does not display anything in the JLabel
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a lot depends on how the 2nd frame opens - starts at same time as 1st frame?, opens as a result of some action on frame1? etc

if it opens from frame1, and it opens just to get some info for frame1, frame2 should be a JDialog.

it would go something like this

reply
    Bookmark Topic Watch Topic
  • New Topic