package com.company;

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

public class Main extends JFrame {
    Main(){
        setBounds(100,100,500,300);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        Container c=getContentPane();
        JTextArea area=new JTextArea();//文本域
        JScrollPane sp=new JScrollPane(area);//创建滚动面板,给文本域添加滚动条
        c.add(sp);//容器添加滚动面板
        setVisible(true);
    }

    public static void main(String[] args) {
        new Main();
    // write your code here
    }
}

 java,枯燥中遇见美丽JFrame,窗体(滚动面板JScrollPane)

 

相关文章:

  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2021-12-03
  • 2021-10-22
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-08-20
相关资源
相似解决方案