有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Java/JTable更改JTable滚动条的大小

我有一个JTable,其中滚动条比例失调,有点像是从JTable中“退出”。我该怎么调整呢?查看图片

enter image description here

enter image description here


共 (1) 个答案

  1. # 1 楼答案

    1. In the constructor after the function (normally,initComponents()) that initializes the Jtable, just put :
    this.jScrollPane1.getVerticalScrollBar().setPreferredSize(new Dimension(100,0));
    
    • 注意:在我的例子中,Jtable的变量名是jScrollPane1