Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

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

xiao li
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
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"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Report post to moderator
This has been responded to here.
Please do not cross post.
Also, please put more meaningful titles than "Need Gurus Help" :roll: .
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!