Which swing components to use?

J

Javaman1003

Hey all, I'm about to write a swing app and I'm trying to figure out
which swing components to use. The main frame of the app will be a
file reader essentially, which is uneditable. I want to be able to
control mouse clicks and highlights on this frame (from mouse,
keyboard etc.).

I also want to have a menu which has some sort of options like Menu:
Edit-> Options which will bring up another window that will allow me
to set some options (will probalby have a checkbox and a text field).

So I was going to use a JFrame with a TextPane for the first piece
(file reader/displayer), but I'm not sure what to use for the menu
dialog. I want to use a JFrame, but when I open one it adds another
bar on the windows toolbar (but it's the same app, so I don't want
that). Can I use an JInternalFrame for this? The only problem I see
with JInternalFrame is that doesn't let the internal frames display if
they're moved outside the border of the original window (desktoppane).

Does anyone have any suggestions? Basically I just want to know the
standard swing components for making a menu driven, multi-framed win32
app.

Thanks ahead of time!
 
A

Andrew Hobbs

Javaman1003 said:
Hey all, I'm about to write a swing app and I'm trying to figure out
which swing components to use. The main frame of the app will be a
file reader essentially, which is uneditable. I want to be able to
control mouse clicks and highlights on this frame (from mouse,
keyboard etc.).

I also want to have a menu which has some sort of options like Menu:
Edit-> Options which will bring up another window that will allow me
to set some options (will probalby have a checkbox and a text field).

Why don't you use the inbuilt Menu system for Swing.

See

http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html
So I was going to use a JFrame with a TextPane for the first piece
(file reader/displayer), but I'm not sure what to use for the menu
dialog. I want to use a JFrame, but when I open one it adds another
bar on the windows toolbar (but it's the same app, so I don't want
that). Can I use an JInternalFrame for this? The only problem I see
with JInternalFrame is that doesn't let the internal frames display if
they're moved outside the border of the original window (desktoppane).

Does anyone have any suggestions? Basically I just want to know the
standard swing components for making a menu driven, multi-framed win32
app.

The overall tutorial is very useful.

http://java.sun.com/docs/books/tutorial/uiswing/index.html

Cheers

Andrew


--
********************************************************
Andrew Hobbs PhD

MetaSense Pty Ltd - www.metasense.com.au
12 Ashover Grove
Carine W.A.
Australia 6020

61 8 9246 2026
metasens AntiSpam @iinet dot net dot au


*********************************************************
 
A

Adam

Javaman1003 said:
Hey all, I'm about to write a swing app and I'm trying to figure out
which swing components to use. The main frame of the app will be a
file reader essentially, which is uneditable. I want to be able to
control mouse clicks and highlights on this frame (from mouse,
keyboard etc.).

I also want to have a menu which has some sort of options like Menu:
Edit-> Options which will bring up another window that will allow me
to set some options (will probalby have a checkbox and a text field).

So I was going to use a JFrame with a TextPane for the first piece
(file reader/displayer), but I'm not sure what to use for the menu
dialog. I want to use a JFrame, but when I open one it adds another
bar on the windows toolbar (but it's the same app, so I don't want
that).

The component you are looking for is JDialog.

Adam
 

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,054
Latest member
TrimKetoBoost

Latest Threads

Top