Here is some sample code if there are any Java
programers who wish to take a look. I'm using IBM's
JDK 1.1.8 and Swing 1.1.1 but if you use something
else I'd like to know if it works for you.
I don't have any "key" entries in my .fvwm2rc file. I
do use xmodmap to remap some keys (as suggested in
IBM's JDK README file).
Exec exec /usr/X11R6/bin/xmodmap -e "keycode 22 =
BackSpace" -e "keysym Alt_L = Alt_L" -e "keysym Alt_R
= Alt_R"
=======================================================
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
public class Menu extends JFrame
{
public Menu()
{
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
Window w = e.getWindow();
w.setVisible(false);
w.dispose();
System.exit(0);
}
});
JPanel panel = new JPanel();
JLabel label = new JLabel("This is a test");
panel.add(label);
JMenuBar menuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
fileMenu.setMnemonic('F');
JMenuItem saveItem = new JMenuItem("Save");
JMenuItem closeItem = new JMenuItem("Exit");
fileMenu.add(saveItem);
fileMenu.add(closeItem);
menuBar.add(fileMenu);
menuBar.setBorder(new
BevelBorder(BevelBorder.RAISED));
this.getContentPane().add(menuBar,
BorderLayout.NORTH);
this.getContentPane().add(panel,
BorderLayout.SOUTH);
this.setSize(new Dimension(300,200));
}
static public void main(String[] argv)
{
Menu menu = new Menu();
menu.setVisible(true);
}
}
__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf! It's FREE.
http://im.yahoo.com/
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Oct 31 2000 - 08:52:13 GMT