皮皮学,免费搜题
登录
搜题
【简答题】
本 题 的 要 求 是 : 1 .单 击 鼠 标 右 键 , 实 现 弹 出 式 多 级 菜 单 , 通 过 " color " 选 择 颜 色 ; 2 . 在 文 本 框 中 根 据 选 择 的 颜 色 设 置 输 出 字 符 的 颜 色 ; 3 . 单 击 鼠 标 右 键 , 选 择 ” exit ”可 以 退 出 程 序 。 程 序 运 行 上 述 笫 一 项 功 能 后 , 界 面 如 下 : 考生要求对 Java_3.java 文件进行完善并调试,使程序显示如上界面 。 由于 Java_3.java 是不完整的,请在注释行“ //******Found****** ”下一行语句的下划线地方填入正确内容,然后删除下划线,请勿注释行或其他己有语句内 容。 存盘时, 文件必须存放在考生文件夹下,不得改变有文件的文件名。 具体程序如下: import javax.swing.*; import java.awt.event.*; import java.awt.*; //*********Found********** public class Java_3 extends ______________________ implements ActionListener { //*********Found********** private ____________________ pop; private JMenu subPop; private JMenuItem color; private JMenuItem exit; private JMenuItem red; private JMenuItem blue; private JTextArea textArea; private JFrame frame; public void initGUI() { pop=new JPopupMenu(); subPop=new JMenu("color"); //*********Found********** red=new JMenuItem("______________________"); red.addActionListener(this); blue=new JMenuItem("blue"); blue.addActionListener(this); subPop.add(red); subPop.add(blue); exit=new JMenuItem("exit"); exit.addActionListener(this); pop.add(subPop); pop.add(exit); frame=new JFrame("popup frame"); textArea=new JTextArea("",10,10); textArea.addMouseListener(this); //*********Found********** frame.getContentPane().add(____________________); frame.setSize(300,300); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } public void actionPerformed(ActionEvent event) { if(event.getSource()==red) { //*********Found********** textArea.setForeground(Color._____________________); textArea.setText("red menu is selected"); } else if(event.getSource()==blue) { textArea.setForeground(Color.blue); textArea.setText("blue menu is selected"); } else if(event.getSource()==exit) { frame.setVisible(false); System.exit(0); } } public void mousePressed(MouseEvent e) { if(e.getModifiers()==e.BUTTON3_MASK) { pop.show(e.getComponent(),e.getX(),e.getY()); } } public static void main(String args[]) { Java_3 example=new Java_3(); example.initGUI(); } }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】( )是 屏风之始。
A.
B.
C.
D.
【判断题】:checked 选择器匹配每个已被选中的 input 元素(只用于单选按钮和复选框)。
A.
正确
B.
错误
【单选题】将奋乃静制成长链脂肪酸酯的前药的目的是
A.
增强选择性
B.
延长作用时间
C.
提高稳定性
D.
降低毒副作用
E.
改善溶解度
【判断题】可摘局部义齿的牙合支托将义齿承受的咀嚼压力传递到天然牙上。
A.
正确
B.
错误
【单选题】《乡村战略规划2018-2022》指出,坚持( )管农村工作。
A.
乡政府
B.
C.
村委会
D.
居委会
【单选题】将氟奋乃静制成长链脂肪酸酯的目的是
A.
延长作用时间
B.
提高稳定性
C.
改善溶解度
D.
降低毒副作用
【单选题】( )是 屏风之始。
A.
B.
C.
D.
【单选题】将奋乃静制成长链脂肪酸酯的目的是
A.
增强选择性
B.
延长作用时间
C.
提高稳定性
D.
改善溶解度
【单选题】将氟奋乃静制成长链脂肪酸酯的目的是( )
A.
增强选择性
B.
延长作用时间
C.
提高稳定性
D.
改善溶解度
E.
降低毒副作用
【单选题】将奋乃静制成长链脂肪酸酯的前药的目的是
A.
延长作用时间
B.
提高稳定性
C.
降低毒副作用
D.
增强选择性
E.
改善溶解度
相关题目: