コード例 #1
0
  public void init() {
    frame = new JFrame();
    frame.setLayout(new FlowLayout());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setTitle("PersistentFrameTest");
    frame.setSize(400, 200);

    JButton loadButton = new JButton("Load");
    frame.add(loadButton);
    loadButton.addActionListener(EventHandler.create(ActionListener.class, this, "load"));

    JButton saveButton = new JButton("Save");
    frame.add(saveButton);
    saveButton.addActionListener(EventHandler.create(ActionListener.class, this, "save"));

    frame.setVisible(true);
  }
コード例 #2
0
 protected void doShift(KeyEvent e) {
   setSelectionModes(e.getModifiersEx());
   super.doShift(e);
 }
コード例 #3
0
 protected void doSelect(MouseEvent e) {
   setSelectionModes(e.getModifiersEx());
   super.doSelect(e);
 }