File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help required on Swings

 
Viswanath Thulluru
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need your help in implementing a swings application. I have a JFrame containing 2 JPanels : Top & Bottom panel. Top panel has a Jcombobox, Botton panel contain a Graph plot. On changing value in combo box, graph plot should get updated.
I am new to Swings, can you please guide me how I can achieve this?.

I thought of adding actionlistener to Jcombobox. Not sure what to implement in its actionPerformed()

Thanks, Viswanath
 
Rob Camick
Ranch Hand
Posts: 2473
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what to implement in its actionPerformed()


The code to update your Graph plot.

We know nothing about how your Graph works or how the combo box will affect the Graph, so only you can answer that question on how the Graph should be updated.
 
K. Tsang
Bartender
Pie
Posts: 3222
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy

The key to these kind of interaction is to make sure that the combo box and graph plot are in the same class or have some way to access one from the other.

Deciding where to put your components is a design issue somewhat. You don't want to be too cohesive or tightly coupled, yet just enough to function properly.

 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing is a proper noun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic