Modelling question

  • Thread starter Luc Van Biervliet
  • Start date
L

Luc Van Biervliet

Hello all,

I need to write a small java-application. I have to build the user-interface
out of
Swing-components (for most users) and out of Awt-components (for users who
can't
use Swing).
How can i model/do this?

Requirements:
- The user-interface is an instance of a direct subclass of java.awt.Frame
- I wanna use the following awt-components: Label, List, TextArea, TextField
- I wanna use the following swing-components: JLabel, JList, JTextArea,
JTextField

Thanks for your advice,

Luc
 
R

Rhino

I'm not really sure I understand what you mean by "model" in your question.

If it was my project or assignment, I'd write the code using the AWT
components, then, once I had it working, I would change each of the AWT
components to their corresponding Swing components so that TextFields became
JTextFields, Frames became JFrames, etc. Then, I'd fix the inevitable
compile errors and test the Swing version. That's basically the process I
went through to convert my old AWT programs over to Swing versions.

Assuming that you are already familiar with all of the components, that
shouldn't be hard to do. If some of the components are *not* familiar to
you, I'd suggest the Java Tutorial which can be viewed online or downloaded
to run on your own computer. The Java Tutorial explains the Swing components
pretty well. It looks as if the AWT components aren't really covered in the
Java Tutorial any more; at least I couldn't find them in a quick glance.
Maybe a trip to your local bookstore or library would help you find an older
Java book that discusses these in more detail. Of course the AWT components
are still in the API but that's not the nicest way to learn these
components.

As I said, I didn't really understand your question so I don't know if I've
answered it. If I haven't clarify your question and maybe someone can give
you a better answer.

Rhino
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top