简体   繁体   English

将行对齐到JTable中的右侧

[英]Align Rows to Right Side in JTable

How to align rows to the right side in a JTable? 如何将行对齐到JTable的右侧?
In this picture, the rows are aligned to left, how can I align the rows to the right side? 在这张照片中,行向左对齐,如何将行向右对齐?

在此处输入图片说明

Simplest solution is to put your JTable in JScrollPane, and put this pane on plase of yours JTable and JTableHeader. 最简单的解决方案是将JTable放在JScrollPane中,然后将此窗格放在JTable和JTableHeader的上方。 JScrollPane will made everything for you without any headache. JScrollPane会为您提供所有功能,而不会带来任何麻烦。

yourPanel.add( new JScrollPane(yourTable) );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM