-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.3.0
-
x86
-
solaris_2.6
This is a Java2-only bug. I compiled and ran the following program (from "Java 1.2 and JavaScript for C and C++ Programmers") on SunOS 5.6.
jdk 118 displayed just as the book said it would in Figure 3.6.... window containing a text string and an OK button.
jdk122 displayed only the title bar of the window. When I manually resized the window, the text string "A serious Error" never appeared. I only saw the OK button.
The bug still happens on jdk1.3beta.
In both cases I was displaying to an NT box running eXceed 6.0 and eXceed 6.2.
The machine running the java application was an Intel PPro 200mhz with 48mb ram and Solaris 2.6.
//----------------------------Warning.java-------------------------------
//package jwiley.chp3;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Panel;
import java.awt.Point;
/**
* Simple class to demonstrate inheritance.
*/
class Warning extends Frame implements ActionListener
{
/** Warning message. */
private String message;
/** constructor. */
Warning(String title, String WarningMessage)
{
super(title);
message = new String(WarningMessage);
Panel p = new Panel();
Button okButton = new Button("OK");
okButton.addActionListener(this);
p.add("Center", okButton);
add("South",p);
setSize(200,100);
setLocation(new Point(50,50));
setForeground(Color.black);
setBackground(Color.white);
setVisible(true);
}
/** event handler. */
public void actionPerformed(ActionEvent evt)
{
if ("OK".equals(evt.getActionCommand()))
{
System.exit(1);
}
}
/** paint() method. */
public void paint(Graphics g)
{
g.drawString(message,10,40);
}
/** main() method to invoke from JVM. */
public static void main(String args[])
{
Warning anError = new Warning("Error", "A serious Error");
}
}
jdk 118 displayed just as the book said it would in Figure 3.6.... window containing a text string and an OK button.
jdk122 displayed only the title bar of the window. When I manually resized the window, the text string "A serious Error" never appeared. I only saw the OK button.
The bug still happens on jdk1.3beta.
In both cases I was displaying to an NT box running eXceed 6.0 and eXceed 6.2.
The machine running the java application was an Intel PPro 200mhz with 48mb ram and Solaris 2.6.
//----------------------------Warning.java-------------------------------
//package jwiley.chp3;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Panel;
import java.awt.Point;
/**
* Simple class to demonstrate inheritance.
*/
class Warning extends Frame implements ActionListener
{
/** Warning message. */
private String message;
/** constructor. */
Warning(String title, String WarningMessage)
{
super(title);
message = new String(WarningMessage);
Panel p = new Panel();
Button okButton = new Button("OK");
okButton.addActionListener(this);
p.add("Center", okButton);
add("South",p);
setSize(200,100);
setLocation(new Point(50,50));
setForeground(Color.black);
setBackground(Color.white);
setVisible(true);
}
/** event handler. */
public void actionPerformed(ActionEvent evt)
{
if ("OK".equals(evt.getActionCommand()))
{
System.exit(1);
}
}
/** paint() method. */
public void paint(Graphics g)
{
g.drawString(message,10,40);
}
/** main() method to invoke from JVM. */
public static void main(String args[])
{
Warning anError = new Warning("Error", "A serious Error");
}
}