zoukankan      html  css  js  c++  java
  • 利用JTable类直接创建表格(带滑轮)

    public class ExampleFrame_01 extends JFrame{
    
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            ExampleFrame_01 frame = new ExampleFrame_01();
            frame.setVisible(true);
    
        }
        public ExampleFrame_01() {
            // TODO Auto-generated constructor stub
            super();
            setTitle("创建可以滚动的表格");
            setBounds(100,100,240,150);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            String[] columnNames = {"A","B"};
            String[][] tableValues = {{"A1","B1"},{"A2","B2"},{"A3","B3"},{"A4","B4"},{"A5","B5"}};
            JTable table = new JTable(tableValues,columnNames);
            JScrollPane scrollPane = new JScrollPane(table);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
        }
    }
  • 相关阅读:
    ==和===
    Println、Printf、Sprintf区别
    BurpSuite代理https
    scp
    Tomcat Ajp(CVE-2020-1938)
    Chrome-HackBar破解
    crontab
    Sql注入之postgresql
    Sql注入之oracle
    LeetCode简单题(一)
  • 原文地址:https://www.cnblogs.com/dulute/p/10674850.html
Copyright © 2011-2022 走看看