xiao li

Greenhorn
+ Follow
since Apr 09, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by xiao li

Hi Lavanya,
I tried your suggestions, add KeyListener to the comboBox's container, and add one more variable m_ProcessKey. and this is my added code:
/**
* Handle the key pressed event
*/
public void keyPressed(KeyEvent e)
{
if(!m_ProcessKey && e.getKeyCode()==18)//ALT=18
{
m_ProcessKey = true;
}
}
/**
* Handle the key released event
*/
public void keyReleased(KeyEvent e)
{
if(m_ProcessKey && e.getKeyCode()==18)//ALT=18
{
m_ProcessKey = false;
}
}

/**
* Handle the key typed event
*/
public void keyTyped(KeyEvent e)
{
if(m_ProcessKey)
{
if(e.getKeyChar()=='m') // my mnemonic key is M
{
m_Combo.showPopup();
}
else
{
m_Combo.hidePopup();
}
}
}
It works! Thanks a lot.
22 years ago
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 ()
{
label1.setDisplayedMnemonic('A');
label2.setDisplayedMnemonic('B');
label3.setDisplayedMnemonic('C');
vector.addElement(label1);
vector.addElement(label2);
vector.addElement(label3);
list = new JList(vector);
scrollpane= new JScrollPane(list);
setSize(400, 100);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(BorderLayout.CENTER, scrollpane);
setVisible(true);
}
public static void main(String ag[])
{
MnemonicTest mt = new MnemonicTest ();
}
}
Thanks in advance!!
22 years ago
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 ()
{
label1.setDisplayedMnemonic('A');
label2.setDisplayedMnemonic('B');
label3.setDisplayedMnemonic('C');
vector.addElement(label1);
vector.addElement(label2);
vector.addElement(label3);
list = new JList(vector);
scrollpane= new JScrollPane(list);
setSize(400, 100);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(BorderLayout.CENTER, scrollpane);
setVisible(true);
}
public static void main(String ag[])
{
MnemonicTest mt = new MnemonicTest ();
}
}
Thanks in advance!!
22 years ago
Hi Swing Gurus,
I have set a label for a comboBox, and the label has it mnemonic key setup. When I use Alt+mnemonic key of the label, I want to see the focus move to the comboBox and the list box should drop. (right now the list can drop only when the mouse is pointing the comboBox)
Thansk a lot.
22 years ago
Thanks Dave, I will try it over there.
22 years ago
Thanks Dave, that's what I want.
By the way, do you know is there any easy way for doing the following?
when user press Alt+ a mnemonic key in a label(the label is set for a comboBox), the focus should move to the comboBox and the list shoould drop, and the first item should be highlighted.
Thanks, always.
22 years ago
Hi,
I can only find the latest java1.3 source code,
can anyone tell me where is the sdk1.4 source code located?
Thanks a lot.
22 years ago
Hi Guru,
could you tell me where can i download java1.4 source code? thanks a lot!
22 years ago
Thanks Cindy, you are my saver.
22 years ago
I need to set mnemonic key for the title of the
tabbedpane, so user can use ALT+mnemonicKey to access different tabbedPane directly.
Thanks a lot!!!
22 years ago
Thanks, but I need to set specific letter to access the title of the tabbedPane not the button.
waiting for your help......
22 years ago
How can I set a mnemonic key for a tabbedPane?
So the user can use ALT+key to tab to the different tabbedPane?
Thanks a lot.
22 years ago
URGENT!
Does anyone have the experience to set the mnemonic key for the tabbedPane? So the user can use the ALT+keyDefined to tabbed to the different panes?

Thanks a million!!
22 years ago