这可能吗?
我希望我能告诉你我的代码,但我不知道从哪里开始。我还没有在谷歌上找到一个例子。
如果有可能,有人可以请我参考样品吗?
LstGlossary.setModel(
new javax.swing.AbstractListModel() { String[] strings = { "你好", "哈囉" };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
LstGlossary.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
以下是这两个字符串在Microsoft Word中从右到左显示垂直文本方向的内容:
答案 0 :(得分:2)
使用setComponentOrientation
方法:
jlist.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
来自Javadoc:
设置用于订购的语言敏感方向 此组件中的元素或文本。语言敏感 LayoutManager和Component子类将使用此属性 确定如何布局和绘制组件。