Swing组件支持显示HTML,例如:
import javax.swing.JFrame; import javax.swing.JButton; import java.awt.GridLayout; public class HTMLButtons extends JFrame{ HTMLButtons(){ setSize(400,200); getContentPane().setLayout(new GridLayout(1,4)); getContentPane().add(new JButton( "
1st
")); getContentPane().add(new JButton( "2nd
")); getContentPane().add(new JButton( "3rd
")); getContentPane().add(new JButton( "4th
")); } public static void main(String[] args) { new HTMLButtons().setVisible(true); } }转载于:http://blog.itpub.net/62112/viewspace-780779/