小编See*_*tah的帖子

java中按钮的大小

在此输入图像描述

我想控制按钮的大小,我使用方法setBounds但是没有变化,这是我的代码

       public class levels extends JFrame implements ActionListener{

 //Variables 
private static JLabel chooseLevel;
private static JButton easyPuzzle;
private static JButton mediumPuzzle;
private static JButton hardPuzzle;
 // End Of Variables 
Run Code Online (Sandbox Code Playgroud)

这主鳕鱼

public static void main(String[]args){

levels level = new levels();
level.setBounds(400, 190, 450, 450);
level.setVisible(true); // frame is visible
level.setResizable(false); // not Resizable frame 
level.setTitle("Puzzle Number : New Game");  // Title Of the frame
Run Code Online (Sandbox Code Playgroud)

容器添加组件

   Container cN = level.getContentPane(); //  Container to add components for farme 1
   GridLayout gN = new …
Run Code Online (Sandbox Code Playgroud)

java swing jbutton layout-manager

3
推荐指数
1
解决办法
172
查看次数

标签 统计

java ×1

jbutton ×1

layout-manager ×1

swing ×1