When did you______see John
A.last B.lastly C.late D.lately
参考答案:A
本题的功能是定义自己的组件类。窗口中排布着12个按钮,鼠标移动按钮时,按钮背景颜色改变,用鼠标单击按钮时,后台将显示该按钮对应的字符。 import java.awt.*; import java.awt.event.*; import java.util.*; class java3 extends Frame String keys="123456789*0#"; java3() super("java3"); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); setLayout(new GridLayout(4,3,6,6)); for(int i=0;i<keyslength;i++)) KeyButton kb=new KeyButton(keys.charAt(i)); kb.addkeyListener(this); kb.setBackground(Color.pink); kb.setForeground(Color.black); add(kb); setSize(200,200); show(); class KeyEventHandler extends KeyAdapter public void keyTyped(KeyEvent evt) System.out.println(evt.getChar()); public static void main(String[]args) new java3(); class KeyButton extends Component KeyListener keyListener; boolean highlighted; char key; KeyButton(char k) this.key=k; addMouseListener(new MouseEventHandler()); public void paint(Graphics g) int w=getSize().width; int h=getSize().height; String s=""+key; FontMetrics fm=g.getFontMetrics(); if(highlighted) g.setColor(getBackground()); g.fillRoundRect(0,0,w-1,h-1,10,10); g.setColor(getForeground()); g.drawRoundRect(0,0,w-1,h-1,10,10); g.drawstring(s,(w-fm.stringWidth(s))/2, (h-fm.getHeight())/2+fm.getAscent()); class MouseEventHandler extends MouseAdapter public void mousePressed(MouseEvent evt) if(keyListener!=null) keyListener.keyTyped( new KeyEvent(KeyButton.this,KeyEvent.KEY_TYPED, System.currentTimeMillis(), 0,KeyEvent.VK_UNDEFINED,key)); public void mouseEntered(MouseEvent evt) highlighted=true; repaint(); public void mouseExited(MouseEvent evt) highlighted=false; repaint(); public synchronized void addKeyListener(KeyListener 1) keyListener=AWTEventMulticaster.add(keyListener,1); public synchronized void removeKeyListener(KeyListener 1) keyListener=AWTEventMulticaster.remove(keyListener,1);
一台停放车辆起火燃烧,公安消防部门火因鉴定结论为“燃烧严重,火因无法确定,不排除自然原因”,请问车辆损失保险公司是否赔付?