网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
JAVA中,对于drawImage(image,x,y,width,height,this)方法解释正确的是()。
A

image是要绘制的图像

B

x,y是表示图像的中心的位置

C

width是源图像的宽度

D

this是容器


参考答案

参考解析
解析: 暂无解析
更多 “多选题JAVA中,对于drawImage(image,x,y,width,height,this)方法解释正确的是()。Aimage是要绘制的图像Bx,y是表示图像的中心的位置Cwidth是源图像的宽度Dthis是容器” 相关考题
考题 对于drawImage(image,x,y,width,height,this)方法解释正确的是()。 A.image是要绘制的图像B.x,y是表示图像的中心的位置C.width是源图像的宽度D.this是容器

考题 要向Applet传递参数,应该在下列drawing.html文件的下划线处填入的选项是……applet code=DrawImage.class width=100 height=100/applet……A.param image,“flower.gif”B.param image value= flower .gifC.param name= image value=“flower .gif”D.param name=“image”value=“flower.gif”

考题 以下程序段,图形框运行后的效果为( )PrivateSubImage1_Click()Image1.Move(Form1.ScaleWidth-Image1.Width)\2,(Form1.ScaleHeight-Image1.Height)\2,Image1.Width\2,Image1.Height\2EndSubA.单击图形框,移动图形框起始点到窗体中心位置,图形大小不改变B.单击图形框,移动图形框起始点到窗体中心位置,图形宽度改变为原来1/4C.单击图形框,移动图形框起始点到窗体中心位置,图形宽度改变为原来1/2D.以上说法都不正确

考题 下面Applet程序的功能是统计在平面坐标系第一象限中,半径大于9,小于10的圆环中坐标值为整数的点有多少?并且给出其坐标值。请改正程序中的错误(有下画线的语句),使程序执行后,能得到预期的结果。import java.awt.*;import java.applet.*;/*<applet code=Di9Ti width=200 height=100></applet>*/public class Di9Ti extends Applet{public void paint(Graphics g){int x,y,r1=5,r2=4;int count=0;for(x=1;x<y;x++){for(y=1;y<r1;y){if(x*x+y*y<=r2*r2||x*x+y*y>=r1*r1)break;g.drawStdng("x="+x+"y="+y,20+count*80,20);count++;}}g.drawString("count="+count,20,40);}}ex11_3.html:<html><head><title>A Simple Program</title></head><body><applet code="Di9Ti.class"width=800 height=400></applet></body></html>

考题 本题的功能是监听鼠标左右键的单击,以及面板中滚动条的添加。在窗口的画板中单击鼠标左键,在单击的位置绘制一个圆,当绘制的圆大于画板的大小时,画板就添加滚动条,在画板中单击鼠标右键,则清除画板中的所有图形。 import javax.swing.*; import javax.swing.event.MouselnputAdapter; import java.awt.*; import java.awt.event.*; import java.util.*; public class java3 extends JPanel{ private Dimension size; private Vector objects; private final Color colors[]={ Color.red,Color.blue,Color.green,Color.or- ange, Color.cyan,Color.magenta,Color.darkGray, Color.yellow); private final int color_n=colors.length; JPanel drawingArea; public java3{ setopaque(true); size=new Dimension(0,0); bjects=new Vector; JLabel instructionsLeft=new JLabel("单击鼠标 左键画圆."); JLabel instructionsRight=new JLabel("单击鼠 标右键清空画板."); JPanel instructionPanel=new JPanel(new Grid- Layout(0,1)); instructionPanel.add(instructionsLeft); instructionPanel.add(instructionsRight); drawingArea=new JPanel{ protected void paintComponent(Graphics g){ super.paintComponent(g); Rectangle rect; for(int i=0;iobjects.size;i++){ rect=(Rectangle)objects.elementAt(i): g.setColor(colors[(i%color_n)]); g.fillOval(rect.X,rect.Y,rect.width,rect. height); } } }; drawingArea.setBackground(Color.white); drawingArea.addMouseListener(new MouseLis- tener); JScrollPane scroller=new JScrollPane(drawing- Area); scroller.setPreferredSize(new Dimension(200, 200)); setLayout(new BorderLayout); add(instructionPanel,BorderLayout.NORTH); add(scroller,BorderLayout.CENTER): } class MyMouseListener extends mouseInputAdapt- er{ final int W=100; final int H=100; public void mouseReleased(MouseEvent e){ boolean changed=false; if(SwingUtilities.isRightMouseButton(e)){ objects.removeAllElements; size.width=0; size.height=0; changed=true; }else{ int X=e.getX-W/z; int Y=e.getY-H/2 if(x0)x=0; if(yO)Y=0; Rectangle rect=new Rectangle(X,Y,W,H); objeets.addElement(rect); drawingArea.scrollRectToVisible(rect); int this_width=(x+W+2); if(this widthsize.width) {size.width=this_width;changed=true;} int this=height=(y+H+2); if(this_heightsize.height) {size.height=this_height;changed=true;} } if(changed){ drawingArea.setPreferredSize(size); drawingArea.revalidateI; } drawingArea.paint; } } public static void main(String args[]){ JFrame. frame=new JFrame("java3"): frame.addWindowListener(new WindowAdapter { public void windowClosing(WindowEvent e) {System.exit(0);} }); frame.setContentPane(new java3); frame.pack; frame.setVisible(true); } }

考题 以下代码片断中,属于绝对定位的是()。A、#box{width:100px;height:50px;position:absolute;}B、#box{width:100px;height:50px;position:static;}C、#box{width:100px;height:50px;position:relative;}D、#box{width:100px;height:50px;}

考题 下面是一个Applet程序,其功能是绘制三维矩形以使该矩形面凹下,并将图像放入凹下的矩形面中。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。注意:不改动程序的结构,不得增行或删行。源程序文件代码清单如下:import java.awt.*;import java.applet.*;import java.awt.image.*;import java.util.*;import java.net.*;/*<applet code="ex01_3.class"width=800 height=400></applet>*/public class ex01_3 extends Applet{private Image IMG nClick=over(this) title=放大;public void init(){URL url=getCodeBase();IMG nClick=over(this) title=放大=getImage(url,"ex01_3.gif");MediaTracker mt=new MediaTracker();mt.addImage(IMG nClick=over(this) title=放大,1);try{mt.waitForAll();} catch(Exception e){e.printStackTrace();}setBackground(Color.black);}public void paint(Graphics g){int thick=3,x=10,y=10;g.drawImage(IMG nClick=over(this) title=放大,x,y);g.setColor(Color.lightGray);int w = IMG nClick=over(this) title=放大.getWidth(this);int h = IMG nClick=over(this) title=放大.getHeight(this);for(int i=0;i<thick;i++)g.draw3DRect(x,y,w+(a*i),true);}}ex01 3.html<HTML><HEAD><TITLE>ex01_3</TITLE></HEAD><BODY><applet code="ex01_3.class"width=800 height=400></applet></BODY></HTML>

考题 下面Applet程序的功能是统计在平面坐标系中第一象限中,半径大于9,小于10的圆环中坐标值为整数的点有多少?并且给出其坐标值.请改正程序中的错误(有下划线的语句),使程序执行后,能得到预期的结果。注意:不改动程序的结构,不得增行或删行。程序的执行结果为:import java.awt.*;import java.applet.*;/*<applet code=Di9Ti width=200 height=100></applet>*/pubic class Di9Ti extends Applet{public void paint(Graphics g){int x,y,r1=5, r2=4;int count=0;for(x=1; x<y;x++){for(y=1;y<r1;y){if(x*x+y*y<=r2*r2||x*x+y*y>=r1*r1)break;g.drawString("x="+x+"y="+y,20+count*80,20);count++;}}g.drawstring("count="+count,20,40);}}ex38_3.html:<html><head><title>A Simple Program</title></head><body><applet code="Di9Ti.class" width=800 height=400></applet></body></html>

考题 下面是一个Applet程序,程序的功能输出一个彩色窗体。请改正程序中的错误(有下划线的语句),使程序能输出正确结果。注意:不改动程序的结构,不得增行或删行。程序的输出结果为:import java.awt.*;import java.awt.image.*;import java.applet.Applet;public class MemoryImage extends Applet{Image IMG nClick=over(this) title=放大;public void init(){Dimension d=getSize();int w=d.width,h=d.height;int pix[ ]=new int[w*h];int index=0;for(int y=0;y<h;y++)for(int x=0;x<w;x++){int red=(x|y)0xff;int green=(x*2|y*2)0xff;int blue=(x*4|y*4)0xff;pix[index++]=(255<<24)|(red<<16)|(green<<8)|blue;}IMG nClick=over(this) title=放大=createImage(new FilteredImageSource(w,h,pix, 0,w));}public void paint(Graphics g){g.drawImage(IMG nClick=over(this) title=放大, 0,0,super);}}ex36_3.html:<html><head><title>A Simple Program</title></head><body><applet code=" MemoryImage.class" width=800 height=400></applet></body></html>

考题 下面是一个Applet程序,其功能是用一组坐标点绘制一个多边形,并通过沿坐标的垂直方向移动,把它移到窗口的下半部分,然后填充它。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。注意:不改动程序的结构,不得增行或删行。源程序文件清单如下:import java.awt.*;import java.applet.*;/*<applet code="ex11_3.class"width=800 height=400></applet>*/public class ex11_3 extends Applet{int[] x = {15,50,100,160,120,190 };int[] y = {15,100,30, 15, 80, 50 };public void init(){setBackground (Color. lightGray);}public void paint (Graphics g){int[] y2 = new int[6];g. setColor (Color. red);Rectangle rect = getBounds();g.drawPolygon (x, y2,6);for(int i=0; i<6; i++)y2[i] = y[i] + (rect.height / 2);g. fillPolygon (x, y, 6);}}ex11_3. html<HTML><HEAD><TITLE>ex11_3</TITLE></HEAD><BODY><applet code="ex11_3.class" width=800 height=400 ></applet></BODY></HTML>

考题 在CSS语言中下列哪一项是"列表样式图象"的语法()。A.width:B.height:C.white-space:D.list-style-image:

考题 有关绘图,下面的说法正确的是( )。 Ⅰ:drawArt(int x,int y,int width,int height,ing stanAngle,int arcAngle)是用来指定在矩形的边界内从起始角度到结束角度之间画弧。 Ⅱ:drawLine(int x1,int y1,int x2,int y2)用来绘制从点(x1,y1)到(x2,y2)的线段。当计算出线段上点的坐标不是整数时,向该点的右下方取整。 Ⅲ:drawRet(int x,int y,int width,int height)绘制指定矩形的轮廓。 Ⅳ:drawPloygon(Polygon p)绘制由特定的点指定的多边形。A.Ⅱ、ⅢB.Ⅱ、Ⅲ、ⅣC.Ⅰ、ⅡD.Ⅰ、Ⅲ、Ⅳ

考题 下面是一个Apple(程序,其功能是播放动画。要求根据给出的3幅图片设计1个动画。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。注意:不改动程序的结构,不得增行或删行。程序运行结果如下:import java.awt.*;import java.applet.*;import java.awt.image.*;/*<applet code="ex24_3.class" width=800 height=400 ></applet>*/public class ex24_3 extends Applet implements Runnable {Image[] images=new Image[4];Image image;int IMG nClick=over(this) title=放大Number=3;int currentImage=0;Thread thisThread;public void init(){for (int x=0;x<IMG nClick=over(this) title=放大Number;x++){images[x]= getImage(getCodeBase(),"IMG nClick=over(this) title=放大"+x+".gif");}image=images[0];}public void paint(Graphics g){g.drawImage(image[0],0,0,null);}public void update(Graphics g){paint(g);}public void start(){thisThread = new Thread(this);thisThread.start();}public void stop(){thisThread.stop();thisThread=null;}public void run(){while(true){currentImage++;currentImage=IMG nClick=over(this) title=放大Number;image=images[IMG nClick=over(this) title=放大Number];repaint();try{thisThread.sleep(100);}catch (Exception e){}}}}ex24_3, html<HTML><HEAD><TITLE>ex24_3</TITLE></HEAD><BODY><applet code="ex24_3.class" width=800 height=400 ></applet></BODY></HTML>

考题 下列Applet实现画一条连接窗口右上角的直线。选择正确的语句填入横线处。 import java.applet.*; import java.awt.*; public class ex25 extends Applet { public void paint (Graphics g) { Dimension d; d = getSize(); ______ } } ______ } }A.g.drawLine(d.width, al.height, 0, 0);B.g.drawLine(0, d.height, d.width, 0);C.g.drawLine(0, 0, d. width, 0);D.g.drawLine(0, d.height, 0, d.width);

考题 ●试题六【说明】下面是一个Applet程序,其功能是在绘图区域中通过鼠标的移动来绘制直线,并且有清除绘图区域按钮,用来清除已经绘制的图像。程序运行结果如图5所示。图5import javA.awt.*;import javA.applet.*;/*applet code=ex6_7.class width=800 height=400/applet*/public class ex6_7 extends Applet{private Button btn;private boolean bDraw, bClear;private int upX, upY,downX, downY;public void init(){setLayout(null);bClear = false;bDraw = false;btn = new Button("clear");btn.reshape(250, 150, 70, 30);add(btn);}public void paint(Graphics g){if(bClear){g.clearRect(0, 0, getSize().width, getSize().height);(1) ;}if(bDraw){g.drawLine( (2) );bDraw = false;}}public void update(Graphics g){(3) ;}public boolean mouseDown(Event event, int x, int y){downX = x;downY = y;return true;}public boolean mouseUp(Event event, int x, int y){upX = x;upY = y;(4) ;repaint();return true;}public boolean action(Event event, Object object){if ( (5) ){bClear = true;repaint();}return true;}}ex6_7.htmlHTMLHEADTITLE ex6_7 /TITLE/HEADBODYapplet code=" ex6_7.class" width=800 height=400 /applet/BODY/HTML

考题 ●试题七【说明】下面是一个Applet程序,其功能是将完整的图像显示于Applet的区块中,然后可以通过拖动鼠标让图像随着鼠标拖动的轨迹而移动。程序运行结果如图5所示。图5import java.applet.*;import java.awt.*;/*applet code="ex4_7.class" width=800 height=400 /applet*/public class ex4_7 extends Applet{private Image iImg;private int xPos,yPos;public void init(){xPos = yPos =(1);iImg = getImage((2)"ex4_7.jpg");}public void paint(Graphics g){g.drawImage(iImg,xPos,yPos,(3));}public boolean(4)(Event e,int x,int y){xPos = x;yPos = y;(5);return true;}}ex4_7.htmlHTMLHEADTITLEex4_7/TITLE/HEADBODYapplet code="ex4_7.class" width=800 height=400 /applet/BODY/HTML

考题 getImage()方法与drawImage()方法都是Image对象的方法。() 此题为判断题(对,错)。

考题 组件的setSize()方法签名正确的是哪项?()A、 setSize(int width,int height)B、 setSize(int x,int y,int width,int height)C、 setSize(Dimension dim)D、以上皆不是

考题 对于drawImage(image,x,y,width,height,this)方法解释正确的是()。     A、image是要绘制的图像B、x,y是表示图像的中心的位置C、width是源图像的宽度D、this是容器

考题 图像在网页显示的代码正确的是()A、<img src="Images/exit.gif"width="69"height="24"B、<imges src="exit.gif"width="69"height="24"C、<img url="Images/exit.gif"width="69"height="24"D、<imge src="Images/exit.gif"width="69"height="24"

考题 JAVA中,对于drawImage(image,x,y,width,height,this)方法解释正确的是()。A、image是要绘制的图像B、x,y是表示图像的中心的位置C、width是源图像的宽度D、this是容器

考题 以下关于width属性和height属性语法格式正确的是()。A、width:15;B、width:60px;C、height:100%;D、height:100;

考题 You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays a high-resolution graphic image named Image1.jpg. You need to limit the width of the image to 200 pixels. You also need to preserve the aspect ratio of the image. Which code fragment should you use?()A、Image Width="200" Source="Image1.jpg"/ ImageWidth="200" Height="200"Source="Image1.jpg"/ ImageWidth="200"Image.SourceB、BitmapImage DecodePixelWidth="200"DecodePixelHeight="200"UriSource="Image1.jpg" / /Image.SourceC、/ImageImage Width="200"Image.SourceD、BitmapImage DecodePixelWidth="200" UriSource="Image1.jpg" //Image.Source /Image

考题 多选题JAVA中,对于drawImage(image,x,y,width,height,this)方法解释正确的是()。Aimage是要绘制的图像Bx,y是表示图像的中心的位置Cwidth是源图像的宽度Dthis是容器

考题 多选题对于drawImage(image,x,y,width,height,this)方法解释正确的是()。Aimage是要绘制的图像Bx,y是表示图像的中心的位置Cwidth是源图像的宽度Dthis是容器

考题 单选题You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays a high-resolution graphic image named Image1.jpg. You need to limit the width of the image to 200 pixels. You also need to preserve the aspect ratio of the image. Which code fragment should you use?()A Image Width=200 Source=Image1.jpg/ ImageWidth=200 Height=200Source=Image1.jpg/ ImageWidth=200Image.SourceB BitmapImage DecodePixelWidth=200DecodePixelHeight=200UriSource=Image1.jpg / /Image.SourceC /ImageImage Width=200Image.SourceD BitmapImage DecodePixelWidth=200 UriSource=Image1.jpg //Image.Source /Image

考题 单选题以下代码片断中,属于绝对定位的是()。A #box{width:100px;height:50px;}B #box{width:100px;height:50px; position:absolute;}C #box{width:100px;height:50px; position:static;}D #box{width:100px;height:50px; position:relative;}

考题 多选题组件的setSize()方法签名正确的是哪项?()AsetSize(int width,int height)BsetSize(int x,int y,int width,int height)CsetSize(Dimension dim)D以上皆不是