最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

求助,為何不能彈出窗口

求助,為何不能彈出窗口

慕妹3559746 2016-09-28 22:09:47
import java.awt.Color;import java.awt.Container;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JDialog;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.SwingConstants;import javax.swing.WindowConstants;class MyDialog extends JDialog{ public MyDialog(MyFrame frame){ super(frame,"第一個(gè)Jdialog窗口",true); Container container=getContentPane(); container.add(new JLabel("這是與各對(duì)話框")); setBounds(120,120,100,100);}}public class MyFrame extends JFrame { public static void main(String[] args) { new MyFrame(); } public MyFrame(){ Container container=getContentPane(); container.setLayout(null); JLabel jl=new JLabel("這是一個(gè)JFrame窗口"); jl.setHorizontalAlignment(SwingConstants.CENTER); container.add(jl); JButton bl=new JButton("彈出對(duì)話框"); bl.setBounds(10,10,100,21); bl.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ new MyDialog(MyFrame.this).setVisible(true); } }); container.add(bl); bl.setVisible(true); jl.setVisible(true); container.setBackground(Color.blue); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); } }
查看完整描述

2 回答

?
RM林夕

TA貢獻(xiàn)3條經(jīng)驗(yàn) 獲得超2個(gè)贊

你這一行注釋都不帶寫的啊,

查看完整回答
反對(duì) 回復(fù) 2016-09-29
?
慕妹3559746

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊

我的神啊,,各位師兄師姐們求助啊

查看完整回答
反對(duì) 回復(fù) 2016-09-28
  • 2 回答
  • 0 關(guān)注
  • 1292 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)