问题 单项选择题

500kV电压等级,带电作业最小组合间隙为()m。

A.4.5;

B.4.3;

C.4;

D.3.8。

答案

参考答案:C

单项选择题
问答题

本题的功能是通过鼠标确定两个点,然后画两点间的直线。窗口中有一个按钮“Draw line”,单击该按钮后,它就处于按下状态,然后用鼠标在窗口中单击一下,在单击的地方就会出现一个坐标圆点,用鼠标在另外一个地方单击一下又会出现另外一个圆点,并且此时在两个坐标圆点间画出一条直线,且“Draw line”处于可用状态,再单击这个按钮就可以画另外一条直线。
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class EventQueuePanel extends JPanel implements ActionListener
EventQueuePanel()
JButton button=new JButton("Draw line");
add(button);
button.addActionListener(this);

public void actionPerformed(AclionEvent evt)
Graphics g=getGraphics();
______p=getClick();
g.drawOval(p.x-2,p.y-2,4,4);
Point q=getClick();
g.drawOval(q.x-2,q.y-2,4,4);
g.drawLine(p.x,p.y,q.x,q.y);
g.dispose();

public Point getClick()
EventQueue eq=Toolkit.getDefaultToolkit().getSystemEventQueue();
while(true)
try
AWTEvent evt=eq.getNextEvent();
if(evt.getID()==MouseEvent.MOUSE PRESSED)
MouseEvent mevt=(MouseEvent)evt;
Point p=______();
Point top=getRootPane().getLoeation()______
p.x-=top.x;
p.y-=top.y;
return p;


catch(InterruptedException e)



private int y=60;

class EventQueueFrame extends JFrame
public EventQueueFrame()
setTitle("java2");
setSize(300,200);
addWindowListener(new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);

);
Container contentPane=getContentPane();
contentPane.add(new EventQueuePanel());


public class java2
public static void main(String[]args)
Frame frame=new EventQueueFrame();
frame.show();