请问怎么在swing界面显示多行静态文本? 如题,我用的是netbeans 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 labelswing控件可接受html,例如<html>第一行<br />第二行</html> import javax.swing.JFrame;import javax.swing.JTextArea;import javax.swing.WindowConstants;public class Test extends JFrame { private JTextArea jTextArea1; public Test() { jTextArea1 = new JTextArea("asfsafsdfsdfsdfsdfsfsaf\nsdfsdfsdfasdfsf");//需要在换行的地方加入\n jTextArea1.setSize(100, 100); jTextArea1.setEnabled(false); setLayout(null); setBounds(400, 200, 400, 400); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); add(jTextArea1); } public static void main(String args[]) { new Test().setVisible(true); }} JLabel可以写内容。JTextArea也可以写内容。 java的api接口要怎么实现 调用父类方法是否正确 Enumeration 是个什么接口哦,有什么用啊? 大家谁知道有没有java实现的视频聊天的开源项目啊? 关于applet ******菜鸟急问:import niit.mypackage.*;时,报错,来者有分,急急急急**** 这个java的程序少什么包么? 请问哪个方法可以得到刚刚executeUpdate(sql)中操作的行的编号??? 谁能具体讲一下jre,jdk,j2sdk的区别? Java初学者问题 关于mysql的一些小问题 小球在边框内随机碰撞运动过程
swing控件可接受html,例如<html>第一行<br />第二行</html>
import javax.swing.JTextArea;
import javax.swing.WindowConstants;public class Test extends JFrame {
private JTextArea jTextArea1; public Test() {
jTextArea1 = new JTextArea("asfsafsdfsdfsdfsdfsfsaf\nsdfsdfsdfasdfsf");//需要在换行的地方加入\n
jTextArea1.setSize(100, 100);
jTextArea1.setEnabled(false);
setLayout(null);
setBounds(400, 200, 400, 400);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
add(jTextArea1);
} public static void main(String args[]) {
new Test().setVisible(true);
}
}