当前位置:网站首页>【无标题】
【无标题】
2022-07-25 11:00:00 【编程老哥】
继承、封装、多态、











面板
import javax.swing.*;
import java.awt.*;
public class Jpanel extends JFrame {
public Jpanel() {
Container container = this.getContentPane();
container.setLayout(new GridLayout(2,1,10,10));//later function is intended
JPanel panel = new JPanel(new GridLayout(1,3));
JPanel panel2 = new JPanel(new GridLayout(1,3));
JPanel panel3 = new JPanel(new GridLayout(1,3));
JPanel panel4 = new JPanel(new GridLayout(1,3));
panel.add(new Button("1"));
panel.add(new Button("1"));
panel.add(new Button("1"));
container.add(panel);
this.setVisible(true);
this.setSize(500,500);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new Jpanel();
}
}JScrollPanel
import javax.swing.*;
import java.awt.*;
public class JScorllDemo extends JFrame {
public JScorllDemo() {
Container container = this.getContentPane();
//TextArea
JTextArea textArea = new JTextArea(20,50);
textArea.setText("welcome to kuangshen java");
container.add(textArea);
//Scroll Panel
JScrollPane scrollPane = new JScrollPane(textArea);
container.add(scrollPane);
this.setVisible(true);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setBounds(100,100,300,300);
}
public static void main(String[] args) {
new JScorllDemo();
}
}

边栏推荐
- WIZnet W5500系列培训活动之“MQTT协议讲解和实践(接入OneNET)”
- session和cookie有什么区别??小白来告诉你
- 世界上最高效的笔记方法(改变你那老版的记笔记方法吧)
- Convert string to number
- SQL injection less17 (error injection + subquery)
- 基于W5500实现的考勤系统
- The first C language program (starting from Hello World)
- 【mysql学习08】
- [IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
- 小微企业智能名片管理小程序
猜你喜欢
随机推荐
SQL injection LESS18 (header injection + error injection)
【mysql学习08】
Reflection reflection
W5500在处于TCP_Server模式下,在交换机/路由器网络中无法ping通也无法通讯。
JS数据类型以及相互转换
return 和 finally的执行顺序 ?各位大佬请看过来,
矩阵的特征值和特征向量
小区蔬菜配送的小程序
基于MATLAB的常见线性调制方法
数据库完整性——六大约束学习
软件测试阶段的风险
Filter过滤器解决request请求参数乱码的原理解析
Information management system for typical works of urban sculpture (picture sharing system SSM)
贪心问题01_活动安排问题
Leetcode sword finger offer 27. image of binary tree
Web APIs(获取元素 事件基础 操作元素)
绘图==PYQT5
Small program of vegetable distribution in community
SQL language (III)
Review in the middle of 2022 | understand the latest progress of pre training model









