• Jframe-项目


    package 窗口;

    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Point;

    import javax.swing.JFrame;
    import javax.swing.JLabel;

    public class Jfiame {

        
        public static void main(String[] args) {
        /*    JFrame f=new JFrame("第一个窗体");
            f.setSize(300,300);//大小
            f.setBackground(Color.BLUE);//颜色
            f.setLocation(300,305);//位置

            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//关闭窗口
            f.setVisible(true);//显示
            */
    //        JFrame f=new JFrame();
    //        Dimension d=new Dimension();
    //        d.setSize(400,400);
    //        f.setSize(d);//设置组件大小
    //        f.setBackground(Color.black);
    //        Point p=new Point(300,200);//
    //        
    //        f.setLocation(p);
    //        f.setVisible(true);
            
            JFrame frame=new JFrame("欢迎来到卫裤");
            
            JLabel lab=new JLabel("waycool",JLabel.CENTER);
            //Font fnt=new Font("黑体",Font.ITALIC, 23);
            Font fnt=new Font("黑体",JFrame.EXIT_ON_CLOSE,20);
            Font fnt1=new Font("黑体",Font.CENTER_BASELINE, 23);
            lab.setFont(fnt);
            frame.add(lab);//将组建传入到面板之中
            Dimension dim=new Dimension();
            frame.setBackground(Color.black);
            dim.setSize(300,200);//显示大小
            frame.setSize(dim);
            Point point=new Point(300,300);//设置坐标
            frame.setLocation(point);
            frame.setVisible(true);
            
            
            
        }
    }

  • 相关阅读:
    DFS复习
    二叉搜索树专题
    二叉树路径问题
    二叉树LCA--leetcode236题
    二叉树创建与前、中、后序遍历
    leetCode--n数之和--哈希表/双指针
    leetCode--单词接龙--BFS
    vue-router简单实现
    Promise的简单实现
    闭包&作用域链&let
  • 原文地址:https://www.cnblogs.com/chaiyingqi/p/7338228.html
Copyright © 2020-2023  润新知