Click to See Complete Forum and Search --> : Using Java Swing: Which Components to use


burung
07-19-2005, 10:39 PM
Hi,

I need a guide here. I want to develop a program to simulate a simple logic circuit (AND, OR, NAND, NOR, XOR, XNOR gates). Here are the properties of the program These gates are images:


There is a dialog box containing all the gates where I can select which gate to use and drag it onto the display area.
The gates on the display area can be connected through lines.
The circuit can accept input bits
The circuit can compute the output bits given the input bits
I can open an input file (probably XML) that contains a circuit and display it on the display area and run simulation on it.


There is a dialog box containing all the gates where I can select which gate to use and drag it onto the display area.
The gates on the display area can be connected through lines.
The circuit can accept input bits
The circuit can compute the output bits given the input bits
I can open an input file (probably XML) that contains a circuit and display it on the display area and run simulation on it.


So, what Java Swing components that I can use to display the circuit? :confused: :confused:

What component of Java Swing that support XML file manipulation?

Any other advice

Thank you.

ironballs
07-20-2005, 02:29 PM
to tell you the truth, I've no idead how to acomlish that using Java,
but it's quite easy to do using 'Virtual Basic 6.0'.
(hope I won't get sacked for saying that in Java forum..... :)

ractoc
07-21-2005, 05:19 AM
This should be possible using Swing, although it will be a challenge to get it right.
What you need to look into is the Drag-And-Drop classes. These facilitate the draging from the dialog box to the display area.
For the display area itself, you might want to extend the existing JPanel class. That way, you;ll be able to override the paint method to do what you want it to do.

burung
07-21-2005, 09:52 PM
Hmmm... seems like a big challenge to me.

However, thank you very much for your responses. Ill try to think of it. At least I got some ideas how to deal with it... Thank you very much

ractoc
07-22-2005, 03:45 AM
If I had more free time on my hands, I'd be willing to help out more. But as it stands now that won't be possible.

Phaelax
07-27-2005, 11:01 PM
I've found 2 links that I think can help you.

http://www.apl.jhu.edu/~hall/CWP-Sources/CWP-Examples/Chapter13/ImageLabel/Icon.html

http://today.java.net/pub/a/today/2004/06/21/nim2.html?page=2