package com;
import javax.swing.*;
public class day1 extends JFrame
!](https://img-blog.csdnimg.cn/20200616112040496.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzQ4NTc5NTU4,size_16,color_FFFFFF,t_70){
public static void main(String[] args)
{
JFrame frame = new JFrame(“zhangshifang”);
//Add a button into the frame
JButton OK = new JButton(“OK”);
frame.add(OK);
frame.setSize(400,300);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

给主页面添加标题和按钮

相关文章:

  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-11-07
  • 2021-12-27
  • 2021-11-29
  • 2022-12-23
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案