求大神f2卡在开机界面,做个java界面程序,题目如6-34所示

安徽农业大学JAVA试题 (6)_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
安徽农业大学JAVA试题 (6)
上传于||文档简介
&&J​A​V​A​考​试
阅读已结束,如果下载本文需要使用2下载券
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩6页未读,继续阅读
你可能喜欢求一道java用户界面设计题的代码_百度知道
求一道java用户界面设计题的代码
com/zhidao/pic/item//zhidao/wh%3D450%2C600/sign=b5f97d190abf5a1e473817d/cadd547de6e0f2d409b3de9d824896;
来自团队:
其他类似问题
为您推荐:
其他2条回答
&import&&&nbsp.setBounds(150;&import&area.ActionEvent.setBounds(500;import&ActionListener()&ActionListener()&nbsp.append(&&import&&&import&void&&&&&)!&300).75;{&30);).EXIT_ON_CLOSE);&nbsp.JScrollP\n&&nbsp.static&10;&clearButton=new&{&&nbsp.addActionListener(new&&JButton&&&nbsp,&&nbsp,&&e)&JPanel&nbsp.jf=new&actionPerformed(ActionEvent&}&&nbsp.ActionL);&200;&JFrame&nbsp.{&nbsp,&nbsp.JBJPanel(null);static&&});import&&public&&nbsp.setResizable(false).setDefaultCloseOperation(JFjavax.setBounds(10;con=new&nbsp.swing.JF+&}&nbsp,&&nbsp,&&&JButton&&&e)&&&nbsp,&&nbsp.&&&JTextArea();&&&&jp=new&nbsp.add(clearButton);&nbsp.JPargs)&&&&&nbsp.setVisible(true);&clearButton.swing.add(jp);clearBHJButton(&clear&public&Multilistener&quot.JTextA&&public&nbsp.setBounds(70;&&area,&main(String[]&class&&&220;Demo{&&void&&private&200);JTextArea&&&&);Hpublic&&220;&void&&&helloButton=new&actionPerformed(ActionEvent&75;{&&JScrollPane&&JFrame();&&&nbsp.add(helloButton)import&&@Override&&&nbsp,&&});&nbsp.setText(&quot!&quot.add(con);&&new&&@Override&&&);&&30);JScrollPane(area);=&JButton(&&helloB&java,&nbsp,&300;{&nbsp.addActionListener(new&&&nbsp,&area&280;&nbsp.setLineWrap(true),&&&con.helloButton.setTitle(&quot
竟然还是英文的,稍等。
很简单 就是一个界面 点击按钮显示hello
import java.awt.BorderL import java.awt.F import java.awt.event.*; import javax.swing.*; public class SayHello extends JFrame {
public static void main(String[] args) {
new SayHello(&SayHello&).display();;
public void display(){
setVisible(true);
private JL
private JTextArea textA
private JB
private JB
private JScrollPane scrollP
public SayHello(String title){
super(title);
initLabel();
initTextArea();
initButton();
initListener();
private void init(){
setResizable(false);
setSize(400, 350);
setDefaultCloseOperation(EXIT_ON_CLOSE);
private void initLabel(){
label = new JLabel(&you have clicked & + times +& times&,JLabel.CENTER);
add(label, BorderLayout.NORTH);
private void initTextArea(){
textArea = new JTextArea();
textArea.setFont(new Font(Font.SERIF, Font.PLAIN, 18));
scrollPane = new JScrollPane(textArea);
scrollPane.setAutoscrolls(true);
add(scrollPane, BorderLayout.CENTER);
private void initButton(){
hello = new JButton(&Hello!&);
clear = new JButton(&Clear&);
JPanel pan = new JPanel();
pan.add(hello);
pan.add(clear);
add(pan, BorderLayout.SOUTH);
private void initListener(){
hello.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
if(times & 0)
textArea.append(&\n&);
textArea.append(&Hello!&);
updateTimes(times);
clear.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
textArea.setText(&&);
times = 0;
updateTimes(times);
private void updateTimes(int times){
label.setText(&you have clicked & + times +& times&);
用户界面设计的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 tpo34独立写作题目 的文章

 

随机推荐