我想制作一个窗口,其中两个按钮的高度很高,一侧有一个滚动条.问题是没有滚动条出现.这是我的代码
public class Window {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//namestanje teme
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
JFrame frame = new JFrame("frame");
// frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setSize(500,500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); …Run Code Online (Sandbox Code Playgroud)