jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes How to show the label with mnemonic key in a scrollPane? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic

How to show the label with mnemonic key in a scrollPane?

xiao li

Joined: Apr 09, 2002
Posts: 13
Hi Swing Gurus,
I need to show the labels with its mnemonic key in a scollPane. but it does not work(neither label nor mnemonic key is shown up).
here is my sample code:
import javax.swing.*;
import java.awt.*;
import java.util.*;
class MnemonicTest extends JDialog
JLabel label1 = new JLabel("A");
JLabel label2 = new JLabel("B");
JLabel label3 = new JLabel("C");
Vector vector = new Vector();
JList list;
JScrollPane scrollpane;

public MnemonicTest ()
list = new JList(vector);
scrollpane= new JScrollPane(list);
setSize(400, 100);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(BorderLayout.CENTER, scrollpane);
public static void main(String ag[])
MnemonicTest mt = new MnemonicTest ();
Thanks in advance!!
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
This has been responded to here.
Please do not cross post.
Also, please put more meaningful titles than "Need Gurus Help" :roll: .

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link: http://aspose.com/file-tools
subject: How to show the label with mnemonic key in a scrollPane?
jQuery in Action, 3rd edition