P
Paul Hamaker
Just found out that a JFrame called Ghost won't show. Inside joke,
easter egg?
easter egg?
Paul said:Just found out that a JFrame called Ghost won't show. Inside joke,
easter egg?
Paul said:I really wasn't kidding, what's up what this, no harm in trying it
yourself :
public class Ghost extends javax.swing.JFrame {
public static void main(String[] args) {
Ghost app=new Ghost();
app.setSize(400,300);
app.setVisible(true);
}
}
I ran it on WinXP home Java1.5.0_06.
Paul said:I really wasn't kidding,
...what's up what this, no harm in trying it
yourself :
Andrew said:..only the two 'Spirit' class frames actually show.
Paul said:Just found out that a JFrame called Ghost won't show. Inside joke,
easter egg?
<sscce>
import java.awt.*;
import javax.swing.*;
class Ghost extends JFrame {
Ghost() {
setPreferredSize(new Dimension(200,200));
getContentPane().add( new JLabel("Boo!") );
pack();
}
}
class TestGhost {
public static void main(String[] args) {
Ghost ghost1 = new Ghost();
PofN said:Bug caused by a hack.
Dialogs always need a parent frame. If you don't provide one Java
creates an internal, empty and hidden one, a "Ghost".
Paul said:Did you run something like this ? default package ?
public class Ghost extends javax.swing.JFrame {
public static void main(String[] args) {
new Ghost().setVisible(true);
}
}
Chris said:Paul Hamaker wrote: ......public class Ghost extends javax.swing.JFrame {
public static void main(String[] args) {
new Ghost().setVisible(true);
}
}
Interesting...
It seems only to happen on Windows -- at least, a quick test with a 1.4 JVM on
Linux did not show the effect.
I spent some time trying to find the source of the effect in the code --
The fact that it /is/ so well hidden, suggests that the Easter egg theory may
be correct. Surely legitimate code (even /bad/ legitimate code as suggested by
"PofN") wouldn't actually be hidden...
Already did.Andrew said:Now that it is established as a bug specific to Windows,
do you intend to lodge a bug-report, Paul?
Already did.
My report has been assigned an internal review ID of 745063, which isWhere? I cannot see it amongst these results.
Paul said:Andrew T. schreef:
My report has been assigned an internal review ID of 745063, which is
NOT visible on the Sun Developer Network (SDN).
Andrew said:Maybe a bug mentioning the word 'ghost' suffers the
same fate as a Frame. ;-)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.