Two Java Noob questions

Started by
0 comments, last by Dave Hunt 18 years, 4 months ago
Ive been making stuff with C++ for years and sometimes used Java (made a simple IRC like chat-system). Anyway I'm going to make a simple IDE. Q1: What Swing class to use for a (Swing UI) list of files? You know the typical IDE project browser. Basically what I want is something like JTextArea but where the user can't select anything but whole lines and when right-clicking on a file brings up a menu (see Q2. Icons would be nice too. Any suggestions? Q2: Is there a floating-menu swing class? Basically what I want is a button with an icon (I have a few tutorials on 2D graphics in Java so no problem there) and when the user presses such a button the app should bring up a menu that is on top of the rest of all Swing components. Like the typical "File Edit View" et.c. menu bar at top but with icons instead of text. Would appreciate all help!
Advertisement
A1: Use a JScrollPane with a JList as the viewport view.

A2: Use a JPopupMenu.

It might be a good idea for you to spend some time browsing the Java 2 Platform API Specification. Select 'javax.swing' from the list of packages and you'll find more than you ever wanted to know about Swing.

This topic is closed to new replies.

Advertisement