开发者

i need help to make a text frame [closed]

It's 开发者_如何转开发difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

is any body knows a code to make a java text frame.,,please i need help


Your question is lacking but...

JFrame frame = new JFrame();
Container cp = frame.getContentPane();
cp.add(new JTextArea());
frame.pack();
frame.setVisible(true);

^ would be the simplest example.

JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container cp = frame.getContentPane();
JTextArea txt = new JTextArea();
JScrollPane scroll = new JScrollPane(txt);
scroll.setPreferredSize(new Dimension(200, 200));
cp.add(scroll);
frame.pack();
frame.setVisible(true);

^ enables scrolling


JTextField tf = new JTextField("Should Do your homework first");

JTextArea ta = new JTextArea("Is this homework, \n the queestion is not clear");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜