如何在Netbeans上定义jRadioButton的标签位置?

gtl*_*wig 3 java swing label netbeans jradiobutton

我想在Netbeans上的buttonGroup上定义jRadioButtons的标签位置,以便标签位于其radioButton下.可以吗?

tra*_*god 5

使用JRadioButton#setText()setVerticalTextPosition(SwingConstants.BOTTOM).

JRadioButton jrb = new JRadioButton();
jrb.setText("Label");
jrb.setVerticalTextPosition(JRadioButton.BOTTOM);
jrb.setHorizontalTextPosition(JRadioButton.CENTER);
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述