我在Eclipse中有JFrame,但是片刻我添加JLayeredPane会自动采用零高度的全宽,即使我尝试调整它的大小,它也没有起作用的光标,但是没有进行大小调整。
这是我的代码,但是我不想通过编码来更改它,我们可以通过向右拖动元素来更改大小?
package com.ayush;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
public class GstDashboard extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
GstDashboard frame = new GstDashboard();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public GstDashboard() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}