File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Help required on Swings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help required on Swings " Watch "Help required on Swings " New topic
Author

Help required on Swings

Viswanath Thulluru
Greenhorn

Joined: Mar 17, 2014
Posts: 8
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

Joined: Jun 13, 2009
Posts: 2227
    
    8
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

Joined: Sep 13, 2007
Posts: 2627
    
    9

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.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19792
    
  20

Swing is a proper noun


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help required on Swings