コード例 #1
0
  UserInputValidationErrorBox(Frame parent, YWorkItem item, YDataStateException e) {
    super(parent, "Problem with your input data");
    Container c = getContentPane();
    c.setLayout(new BorderLayout());
    JPanel p = new JPanel(new BorderLayout());
    p.setBackground(YAdminGUI._apiColour);
    p.add(createTopPanel(item), BorderLayout.NORTH);
    p.add(createCentrePanel(e), BorderLayout.CENTER);
    c.add(p, BorderLayout.CENTER);
    c.add(createBottomPanel(), BorderLayout.SOUTH);
    c.setBackground(YAdminGUI._apiColour);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            storeData();
            this_windowClosing();
          }
        });

    Double screenWidth =
        new Double(
            GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth());
    Double screenHeight =
        new Double(
            GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight());
    setSize(new Double(screenWidth * 0.8).intValue(), new Double(screenHeight * 0.8).intValue());

    Dimension labelSize = this.getSize();
    setLocation(
        screenWidth.intValue() / 2 - (labelSize.width / 2),
        screenHeight.intValue() / 2 - (labelSize.height / 2));
    show();
  }
コード例 #2
0
 SpecificationQueryProcessingValidationErrorBox(
     Frame parent, YWorkItem item, YDataStateException message) {
   super(parent, "Runtime Problem with Process Specification detected");
   Container c = getContentPane();
   c.setLayout(new BorderLayout());
   JPanel p = new JPanel(new BorderLayout());
   p.setBackground(YAdminGUI._apiColour);
   p.add(createCentrePanel(message), BorderLayout.CENTER);
   c.add(p, BorderLayout.CENTER);
   c.add(createBottomPanel(), BorderLayout.SOUTH);
   c.setBackground(YAdminGUI._apiColour);
   addWindowListener(
       new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           storeData();
           this_windowClosing();
         }
       });
   // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   setSize(800, 600);
   Double screenWidth =
       new Double(
           GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth());
   Double screenHeight =
       new Double(
           GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight());
   //        setSize(new Double((screenWidth - guiSize.width) * 2).intValue(), new
   // Double((screenHeight - guiSize.height) * 2).intValue());
   //        setLocation(((screenWidth.intValue() - guiSize.width) / 2),0);
   //        pack();
   Dimension labelSize = this.getSize();
   setLocation(
       screenWidth.intValue() / 2 - (labelSize.width / 2),
       screenHeight.intValue() / 2 - (labelSize.height / 2));
   show();
 }