Swing
窗口、面板
package com.hua.demo4; import javax.swing.*; import java.awt.*; public class JFrameDemo { //init(); 初始化 public void init(){ //顶级窗口 JFrame jf = new JFrame("这是一个JFrame窗口"); jf.setVisible(true); jf.setBounds(100,100,300,200); jf.setBackground(Color.LIGHT_GRAY); //设置文字Jlabel JLabel label = new JLabel("这是一个label"); jf.add(label); //关闭事件 jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);; } public static void main(String[] args) { //建立一个窗口 new JFrameDemo().init(); } }
标签居中
package com.hua.demo4; import javax.swing.*; import java.awt.*; public class JFrameDemo02 { public static void main(String[] args) { new MyJFrame2().init(); } } class MyJFrame2 extends JFrame{ public void init(){ this.setVisible(true); this.setBounds(100,100,200,100); JLabel jlabel = new JLabel("这是一个Jlabel"); this.add(jlabel); //让文本标签居中 设置水平对齐 jlabel.setHorizontalAlignment(SwingConstants.CENTER); //获得一个容器 Container container = this.getContentPane(); container.setBackground(Color.green); } }
我的一生
第1章-废物的一生
第50章-糟糕的婴儿
第300章-莫欺少年穷
第600章-莫欺中年穷
第1000章-莫欺老年穷
第1100章-不详的离去
第1101章-棺材板的震动
第1150章-盗墓贼的眼泪
第1200章-死者为大