FPGA实现串口发送数据

ubuntu18.04编译ORB-SLAM2 TUM数据集(详细步骤)

  返回  

Swing --边框演示

2021/8/20 15:36:32 浏览:
package CaiDan;

import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;

public class BorderTest {
    JFrame f = new JFrame("测试边框");

    public void init(){
        f.setLayout(new GridLayout(2,4));

      Border bevelBorder =   BorderFactory.createBevelBorder(BevelBorder.RAISED,Color.RED,Color.GREEN,Color.blue,Color.GRAY);
        f.add(getJPaneWithBorder(bevelBorder,"BevelBorder"));

      Border lineBorder=  BorderFactory.createLineBorder(Color.ORANGE,10);
        f.add(getJPaneWithBorder(lineBorder,"LineBorder"));

        Border emptyBorder = BorderFactory.createEmptyBorder(10,5,20,10);
        f.add(getJPaneWithBorder(emptyBorder,"EmptyBorder"));

        Border etchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.RED, Color.GREEN);
        f.add(getJPaneWithBorder(etchedBorder,"EtchedBorder"));

        TitledBorder titledBorder = new TitledBorder(new LineBorder(Color.ORANGE,10),"测试标题",TitledBorder.LEFT,TitledBorder.BOTTOM,new Font("StSong",Font.BOLD,18),Color.BLUE);
        f.add(getJPaneWithBorder(titledBorder,"TitledBorde"));

        MatteBorder matteBorder = new MatteBorder(10,5,20,10,Color.GREEN);
        f.add(getJPaneWithBorder(matteBorder,"MatteBorder"));

        CompoundBorder compoundBorder = new CompoundBorder(new LineBorder(Color.RED,10),titledBorder);
        f.add(getJPaneWithBorder(compoundBorder,"CompoundBorder"));

        f.pack();
        f.setVisible(true);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }
    public JPanel getJPaneWithBorder(Border border,String content){
        JPanel  p = new JPanel();
        p.add(new JLabel(content));

        p.setBorder(border);
        return p;
    }
    public static void main(String[] args) {
new BorderTest().init();
    }
}

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号