Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFrame is not displaying properly.

923122Mar 13 2012 — edited Mar 13 2012
Hey there Everyone,

A total, but eager to learn newbie here having problem. I have no idea why this is not displaying correctly:

package Agency_Sys;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;

class Property_Edit_Window extends JFrame
{

private JPanel reg_panel = new JPanel();
private JPanel button_panel = new JPanel();
private JTextField tf_road = new JTextField(12);
private JLabel lb_value = new JLabel("<html><i>value</i></html>");
private JButton jb_ok = new JButton("ok");
private JButton jb_cancel = new JButton("cancel");

public Property_Edit_Window()
{

setLayout(new GridLayout(2,1));

reg_panel.add(tf_road);
reg_panel.add(lb_value);

button_panel.add(jb_ok);
button_panel.add(jb_cancel);

pack();
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
}

}

What I'm getting are not: label, textfield and 2 buttons but only a top part of the frame (it looks like is minimize). Any suggestions welcome!
Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2012
Added on Mar 13 2012
6 comments
716 views