final JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
tabbedPane.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT);
getContentPane().add(tabbedPane, BorderLayout.CENTER);final JLabel tabLabelC = new JLabel();
tabLabelC.setText("选项卡C");
tabbedPane.addTab("选项卡C", imageIcon, tabLabelC, "点击查看选项卡C");final JLabel tabLabelD = new JLabel();
tabLabelD.setText("选项卡D");
tabbedPane.addTab("选项卡D", imageIcon, tabLabelD, "点击查看选项卡C");final JLabel tabLabelE = new JLabel();
tabLabelE.setText("选项卡E");
tabbedPane.addTab("选项卡E", imageIcon, tabLabelE, "点击查看选项卡C");
效果如图所示:紧巴巴的着实难看~
问题是怎么样才能变成下图的效果?自己研究了半天也没搞明白,望高手指教~第一次在CSDN提问题~千万别嫌分少~
tabbedPane.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT);
getContentPane().add(tabbedPane, BorderLayout.CENTER);final JLabel tabLabelC = new JLabel();
tabLabelC.setText("选项卡C");
tabbedPane.addTab("选项卡C", imageIcon, tabLabelC, "点击查看选项卡C");final JLabel tabLabelD = new JLabel();
tabLabelD.setText("选项卡D");
tabbedPane.addTab("选项卡D", imageIcon, tabLabelD, "点击查看选项卡C");final JLabel tabLabelE = new JLabel();
tabLabelE.setText("选项卡E");
tabbedPane.addTab("选项卡E", imageIcon, tabLabelE, "点击查看选项卡C");
效果如图所示:紧巴巴的着实难看~
问题是怎么样才能变成下图的效果?自己研究了半天也没搞明白,望高手指教~第一次在CSDN提问题~千万别嫌分少~
/*更换皮肤
import javax.swing.UIManager;
public class test {
public static void main(String[] args) {
UIManager.LookAndFeelInfo[]
looks = UIManager.getInstalledLookAndFeels();
for(UIManager.LookAndFeelInfo look : looks)
{
System.out.println(look.getClassName());
}
}
} 在你自己的电脑上运行上述代码 输出结果为一下或更多:(如果没有想要的 百度一下 会更多)
com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
/*这一句更换皮肤的代码 括号里的替换掉就可以了
效果如图所示:
<img src="http://img.my.csdn.net/uploads/201211/29/1354174760_9153.png" alt="">
紧巴巴的着实难看~
<span style="color: #FF0000;">问题是怎么样才能变成下图的效果?</span>
<img src="http://img.my.csdn.net/uploads/201211/29/1354174812_4309.png" alt="">
<span style="color: #0000FF;">自己研究了半天也没搞明白,望高手指教~第一次在CSDN提问题~千万别嫌分少~</span><img src="http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/83.gif" alt="">