orig synopsis: "Jpanel Appears on screen with wm icons and title off screen (fvwm and fcwm2)"
Name: boT120536 Date: 01/04/2001
java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SimpleButtonExample2 extends JFrame implements ActionListener {
private String labPrefix = "Number of button clicks: ";
private int numClicks = 0;
private JLabel label = new JLabel(labPrefix + "0 ");
public SimpleButtonExample2 () {
super("Simple Button Example");
JButton qbutton = new JButton("Quit");
qbutton.addActionListener(new QuitButtonListener());
JButton cbutton = new JButton("Press Me");
cbutton.addActionListener(this);
cbutton.setActionCommand("PressMe");
JButton cbutton2 = new JButton("Another");
cbutton2.setActionCommand("Another");
cbutton2.addActionListener(this);
// Create a panel to place the buttons onto
JPanel pane = new JPanel();
pane.add(qbutton);
pane.add(cbutton);
pane.add(cbutton2);
pane.add(label);
// now add the panel to the content pane of the frame
this.getContentPane().add(pane);
this.pack();
this.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("PressMe")) {
numClicks++;
label.setText(labPrefix + numClicks);
} else {
// Trying out the key-mask
System.out.println("Another button pressed");
}
}
public static void main(String[] args) {
SimpleButtonExample2 app = new SimpleButtonExample2();
}
// INNER CLASS
class QuitButtonListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}
}
Window Manager Title and buttons not on screen, when java SimpleButtonExample2
is started.
It seems to place the window and then it is repositioned with the title etc off
screen.
Seems to work ok with sawmill and twm it does not exibit the problem however
fvwm and fvwm2 do.
Solaris 7 and 8 tried with jdks 1.3.0 1.3.0_01 problem does not occur with
jdk 1.2.1_04
Not repeatble on linux 1.3.0_01 and 1.2.2.
(Review ID: 114578)
======================================================================