Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

FlowLayout empty space

683438Jan 7 2011 — edited Jan 9 2011
In program at the end I get a window and empty space below upper frame of the window and above the number in the window. Can anyone please help me get rid of that empty space? That is, how can I move the number higher a bit?
import java.awt.*;
import javax.swing.*; 

public class ShowTime extends JFrame
{
    public static void main(String[] arguments) {
        ShowTime frame = new ShowTime();
        frame.pack();
        frame.setVisible(true);
    }

    JLabel lTime;
    public ShowTime() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        JPanel pane = new JPanel();
        pane.setLayout(new FlowLayout());
        
        lTime = new JLabel("88:88");
        lTime.setFont(new Font ("Helvetica", Font.PLAIN, 88));
        pane.add(lTime);
        setContentPane(pane);
    }
}
This post has been answered by camickr on Jan 8 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 6 2011
Added on Jan 7 2011
5 comments
481 views