M
Michi
hello,
i have the following problem
i wrote a java application with an oracle connection.
i tried to add keylistener in order to interact from my keyboard...
but i doesn't work.
i do things like that:
public void press_abbruch(JButton b)
{
b.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
Object[] msg_abbruch = {"cancel?"};
int frag_abbruch =
JOptionPane.showConfirmDialog(null,msg_abbruch,"Abbruch",
JOptionPane.YES_NO_OPTION,JOptionPane.ERROR_MESSAGE);
if(frag_abbruch == 0)
{
System.exit( 0 );
}
else
{
}
}
}); // Ende MouseListener
b.addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent e)
{
Object[] msg_abbruch = {"cancel?"};
int frag_abbruch =
JOptionPane.showConfirmDialog(null,msg_abbruch,"Abbruch",
JOptionPane.YES_NO_OPTION,JOptionPane.ERROR_MESSAGE);
if(frag_abbruch == 0)
{
System.exit( 0 );
}
else
{
}
}
}); // Ende KeyListener
i guess the mistake could be that i wrote a java class that includes
only my functions - could it be that i call the functions wrong?
if i want to call my functions i can't tab in my application? why?
Michi
i have the following problem
i wrote a java application with an oracle connection.
i tried to add keylistener in order to interact from my keyboard...
but i doesn't work.
i do things like that:
public void press_abbruch(JButton b)
{
b.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
Object[] msg_abbruch = {"cancel?"};
int frag_abbruch =
JOptionPane.showConfirmDialog(null,msg_abbruch,"Abbruch",
JOptionPane.YES_NO_OPTION,JOptionPane.ERROR_MESSAGE);
if(frag_abbruch == 0)
{
System.exit( 0 );
}
else
{
}
}
}); // Ende MouseListener
b.addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent e)
{
Object[] msg_abbruch = {"cancel?"};
int frag_abbruch =
JOptionPane.showConfirmDialog(null,msg_abbruch,"Abbruch",
JOptionPane.YES_NO_OPTION,JOptionPane.ERROR_MESSAGE);
if(frag_abbruch == 0)
{
System.exit( 0 );
}
else
{
}
}
}); // Ende KeyListener
i guess the mistake could be that i wrote a java class that includes
only my functions - could it be that i call the functions wrong?
if i want to call my functions i can't tab in my application? why?
Michi