重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 高职专科
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[主观题]

请在代码中的画线处填写正确的语句【 】,使程序输出hello world!。 //HelloApplet.java Im

port java.awt.*; Import java.applet.*; Public class HelloApplet extends { Public void paint(Graphics g) { ______ ("hello world!",20,20); } }

答案
查看答案
更多“请在代码中的画线处填写正确的语句【 】,使程序输出hello world!。 //HelloApplet.java Im”相关的问题

第1题

阅读下面代码: import java.awt.*; public class Exam11_1 { private Frame.
f; private Button bl,b2,b3,b4; public static void main(String args[] { Exam11_1 that = new Exam11_1 (); that.go(); } public void go () { ______; f.setLayout(new FlowLayout());; bl = new Button ("Button 1"); b2 = new Button ("Button 2"); b3 = new Button ("Button 3"); b4 = new Button ("Button 4"); f.add(b1); f.add(b2); f.add(b3); f.add(b4); f.pack(); f.setVisible(true); } } 请在程序中画线处填写正确的语句【 】,以便编译运行程序后得到正确的结果。

点击查看答案

第2题

阅读下面代码: import java.awt.*; public class Examll_2 { public static v
oid main(String args[]) { ______; f.add("North",new Button("North")); f.add("South",new Button("South")); f.add("East",new Button ("East")) ;; f.add("West",new Button("West")); f.add("Center",new Button ("Center")); f.pack (); f.setVisible(true); } } 请在程序中的画线处添上适当的语句【 】,使程序能正确执行。

点击查看答案

第3题

阅读下面代码: import java.awt.*; public class Exam11_2 { public static
void main (String args[]) { ______; f.add("North",new Button("North")); f.add("South",new Button("South")); f.add("East",new Button("East"));; f.add("West",new Button("West")); f.add("Center",new Button("Center")); f.pack(); f.setVisible(true); } } 请在程序中的画线处添上适当的语句【 】,使程序能正确执行。

点击查看答案

第4题

从对象流中读取对象,请在画线处加入代码完成此程序【 】。 import java.util.*; import ja
va.io.*; public class UnSerializeDate { Date d = null; UnSerializeDate() { try{ FileInputStream f = new FileInputStream("data.ser"); ______; d = (Date) s.readObject(); f.close(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String args[ ]) { UnSerializeDate a = new UnSerializeDate(); System.out.println("The date read is :"+a.d.toString()); } }

点击查看答案

第5题

bar为一JScrollBar组件,阅读下面程序段,请在程序中的画线处填入正确的语句使程序能够正确运行。
... public WellAdjusted() { super("Well Adjusted"); setSize(350,100); bar.addAdjustmentListener(this); value.setHorizontalAlignment(SwingConstants.CENTER); value.setEditable(false); JPanel pane = new JPane(); pane.setLayout(new BorderLayout()); pane.add(value,"Center"): pane.add(bar,"South"); setContentPane(pane); } public void adjustmentValueChanged(AdjustmentEvent evt) { 【 】 if(source ==bar) { int newValue bar.getValue(); value.setText(""+newValue); } repaint(); }

点击查看答案

第6题

bar为一JSerollBar组件,阅读下面程序段,请在程序中的画线处填入正确的语句使程序能够正确运行。
… public WellAdjusted() { super("Well Adjusted"); setSize(350,100); bar.addAdjustmentListener(this); value.setHorizontalAlignment(SwingConstants.CENTER); value.setEditable(false); JPanel pane=new JPane(); pane.setLayout(new BorderLayout()); pane.add(value,"Center"): pane.add(bar,"South"); setContentPane(pane); } public void adjustmentValueChanged(AdjustmentEvent evt) { 【 】 if(source==bar) { int newValue bar.getValue(); value.setText(""+newValue); } repaint(); } …

点击查看答案

第7题

有如下代码片段,请在画线处填入正确的代码,使程序运行正确。 import javax.swing.*; im
port java.awt.*; import java.event.*; public class JAppletTest extends【 】{ public void init() { Container contentPane = getContentPane(); Icon icon = new ImageIcon("swing.gif", "A GIF on a swing"); JLabel label = new JLabel("Swing!", icon, SwingConstants.CENTER); contentPane.add(label, BorderLayout.CENTER); } }

点击查看答案

第8题

下面ButtonFrame类创建了一个容器,包含有3个按键。 import javax.swing.*; public class
ButtonFrame. extends JFrame. { JButton Button1= new JButton("Button1"); JButton Button2= new JButton("Button2"); JButton Button3= new JButton("Button3"); public ButtonFrame() { super("ButtonFrame"); setSize(100,150); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPane1 pane = new JPanel(); pane.add(Buttonl); pane.add(Button2); pane.add(Button3); 【 】; } public static void main(String args[]) { ButtonFrame. bf= new ButtonFrame(); bf.show(); } } 请在程序代码中的画线处添上正确的语句,使程序完整。

点击查看答案

第9题

下面MyFrame类创建了一个简单容器。 import javax.swing.JFrame; public class MyFrame.
extends【 】 { public MyFrame() { super("MyFrame"); setSize(300,100); setDefaultCloseOperation(JFrame.EXIT ON CLOSE); setVisible(true); } public static void main(String[] arguments) { MyFrame. mf= new MyFrame(); } } 请在画线处添上正确的语句,使得程序能够正确运行。

点击查看答案

第10题

通过实现Runnable接口创建线程,请在画线处加入正确的代码完成此程序【 】。 public class Thre
adTest { public static void main(String args[ ]) { Thread t1=new Thread(new Hello()); Thread t2=new Thread(new Hello()); ______; t2.start(); } } class Hello implements Runnable { int i; public void run() { while(true) { System.out.println("Hello"+i++); if(i==5) break; } } }

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝