Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes swing..simple Q? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swing..simple Q?" Watch "swing..simple Q?" New topic
Author

swing..simple Q?

kieran pattni
Ranch Hand

Joined: Jan 19, 2004
Posts: 47
hi..simply question...why doesnt look like Jframe when i run it...it just looks normal frame...
import javax.swing.*;
public class SimpleGui1
{
public static void main(String[] args)
{
JFrame frame = new JFrame();
JButton button = new JButton("Click me");

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.getContentPane().add(button);

frame.setSize(300,300);

frame.setVisible(true);
}
}
thanks in advance
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

In what way are you expecting a JFrame to look different from a Frame? Being empty windows, with decorations drawn by the host windowing system, they're going to look more or less identical.


[Jess in Action][AskingGoodQuestions]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: swing..simple Q?