Maximize کردن Jframe و از بین بردن border

Maximize کردن jframe و از بین بردن border فریم
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class FullScreenJFrame extends JFrame {

public FullScreenJFrame(String title) {
super(title);

this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

setUndecorated(true);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(0, 0, screenSize.width, screenSize.height);
getContentPane().add(new JLabel(“A JFrame Based Kiosk”), BorderLayout.NORTH);
JButton closeButton = new JButton(“Close”);
closeButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent ae) {
System.out.println(“Close button Pressed”);
FullScreenJFrame.this.setVisible(false);
System.exit(0);
}
});
getContentPane().add(closeButton, BorderLayout.CENTER);
}

public static void main(String[] args) {
FullScreenJFrame frame = new FullScreenJFrame(“”);
frame.setVisible(true);
}
}

به نقل از : saeedIRHA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s