Ejemplo n.º 1
0
  /** Builds up the pane. */
  private void buildDesktop(final Container aDesktop) {
    // set up for using the gridbag layout
    aDesktop.setLayout(new GridBagLayout());

    aDesktop.setLayout(new GridBagLayout());
    GridBagConstraints dc = new GridBagConstraints();
    dc.insets = new Insets(2, 2, 2, 2);

    int row = 0;

    dc.anchor = GridBagConstraints.CENTER;
    dc.gridx = 0;
    dc.gridy = row++;
    aDesktop.add(buildBundlePanel(), dc);

    dc.anchor = GridBagConstraints.EAST;
    dc.gridx = 0;
    dc.gridy = row++;
    aDesktop.add(buildInstallPanel(), dc);

    dc.anchor = GridBagConstraints.EAST;
    dc.gridx = 0;
    dc.gridy = row++;
    aDesktop.add(buildButtonsPanel(), dc);
  }
Ejemplo n.º 2
0
  // handle button events by toggling between layouts
  public void actionPerformed(ActionEvent event) {
    if (toggle) container.setLayout(gridLayout2); // set layout to second
    else container.setLayout(gridLayout1); // set layout to first

    toggle = !toggle; // set toggle to opposite value
    container.validate(); // re-lay out container
  } // end method actionPerformed
Ejemplo n.º 3
0
  public MsnTreeTest() {
    String[] tab = {"hello", "test", "blabla"};

    container = getContentPane();
    container.setLayout(null);

    eleve = new DefaultMutableTreeNode("MSN");

    worker = new DefaultMutableTreeNode("Worker");
    prof = new DefaultMutableTreeNode("Profs");

    for (int i = 0; i < tab.length; i++) {
      worker.add(new DefaultMutableTreeNode(tab[i]));
      prof.add(new DefaultMutableTreeNode(tab[i]));
    }
    //        worker.add(new DefaultMutableTreeNode("hello world2"));

    eleve.add(worker);
    eleve.add(prof);

    tree = new JTree(eleve);

    scroll = new JScrollPane(tree);
    scroll.setBounds(10, 10, 100, 100);

    container.add(scroll);

    setSize(300, 300);
    setLocation(200, 200);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);

    //        worker.add(n);

  }
  /**
   * Initializes this window.
   *
   * @param window the component which represents the window. This component will be used when
   *     calling methods like {@link #setWindowBounds(Rectangle, boolean)}. It is the root of this
   *     whole window.
   * @param contentParent the container which will be used as parent for the contents of this
   *     window. This method will change the {@link LayoutManager} and add a child to <code>
   *     contentParent</code>. This component can be the same as <code>window</code>.
   * @param borderAllowed If <code>true</code> and if {@link WindowConfiguration#isResizeable()},
   *     then a new border is installed for the {@link #getDisplayerParent() displayer parent}, and
   *     some {@link MouseListener}s are installed. When the mouse is over the border it will change
   *     the cursor and the user can resize or move the window. If <code>false</code> nothing
   *     happens and the resizing system has to be implemented by the subclass.
   */
  protected void init(
      Component window,
      Container contentParent,
      WindowConfiguration configuration,
      boolean borderAllowed) {
    if (window == null) throw new IllegalArgumentException("window must not be null");

    if (contentParent == null) throw new IllegalArgumentException("contentParent must not be null");

    this.window = window;

    content = createContent(configuration);
    content.setController(getController());
    if (configuration.isResizeable()) {
      contentParent.setLayout(new GridLayout(1, 1));
    } else {
      contentParent.setLayout(new ResizingLayoutManager(this, window));
    }
    contentParent.add(content);

    Container parent = getDisplayerParent();
    parent.setLayout(new GridLayout(1, 1));

    if (configuration.isResizeable() && borderAllowed) {
      if (parent instanceof JComponent && configuration.getBorderFactory() != null) {
        border = configuration.getBorderFactory().create(this, (JComponent) parent);
        border.setController(getController());
        borderModifier = new WindowBorder((JComponent) parent);
        borderModifier.setBorder(border);
        borderModifier.setController(getController());

        ((JComponent) parent).setBorder(border);
      }

      Listener listener = new Listener();
      parent.addMouseListener(listener);
      parent.addMouseMotionListener(listener);
      parent.addComponentListener(listener);
    }

    window.addComponentListener(
        new ComponentAdapter() {
          @Override
          public void componentResized(ComponentEvent e) {
            fireShapeChanged();
          }

          @Override
          public void componentMoved(ComponentEvent e) {
            fireShapeChanged();
          }
        });

    addScreenDockWindowListener(windowListener);
  }
  private static void createTabs() {
    tabbedPane = new JTabbedPane();

    canvasPanel1 = new JPanel();
    canvasPanel1.setLayout(new BorderLayout());
    tabbedPane.addTab("jME3 Canvas 1", canvasPanel1);

    canvasPanel2 = new JPanel();
    canvasPanel2.setLayout(new BorderLayout());
    tabbedPane.addTab("jME3 Canvas 2", canvasPanel2);

    frame.getContentPane().add(tabbedPane);

    currentPanel = canvasPanel1;
  }
Ejemplo n.º 6
0
  protected JXTaskPane getOverviewPane() {
    if (overviewPane == null) {
      overviewPane = new JXTaskPane(STLConstants.K1060_OUTLINE.getValue());
      overviewPane.setUI(new IntelTaskPaneUI());

      Container content = overviewPane.getContentPane();
      content.setLayout(new BorderLayout());

      graphOutline = new TopologyOutlinePanel(updateService, Fit.WIDTH);
      graphOutline.setBackground(UIConstants.INTEL_WHITE);
      graphOutline.setBorder(
          BorderFactory.createCompoundBorder(
              BorderFactory.createLineBorder(UIConstants.INTEL_GRAY),
              BorderFactory.createEmptyBorder(2, 2, 2, 2)));
      content.add(graphOutline, BorderLayout.CENTER);

      enlargeBtn =
          new JXHyperlink(
              new AbstractAction(STLConstants.K1061_ENLARGE.getValue()) {
                private static final long serialVersionUID = -4493041735258083928L;

                @Override
                public void actionPerformed(ActionEvent e) {
                  if (graph != null) {
                    showOutlineWindow();
                  }
                }
              });
      enlargeBtn.setHorizontalAlignment(JButton.TRAILING);
      enlargeBtn.setUnclickedColor(UIConstants.INTEL_BLUE);
      content.add(enlargeBtn, BorderLayout.SOUTH);
    }
    return overviewPane;
  }
Ejemplo n.º 7
0
    public SaveActionListener() {
      // Frame
      saveFrame = new JFrame("Save");
      saveFrame.setSize(SAVE_FRAME_WIDTH, SAVE_FRAME_HEIGHT);

      // Container
      savePane = saveFrame.getContentPane();
      savePane.setLayout(null);

      // Insets
      saveInsets = savePane.getInsets();

      // Components
      // Text field
      name = new JTextField(NAME_COLUMNS);
      name.setBounds(
          saveInsets.left + NAME_X,
          saveInsets.top + NAME_Y,
          name.getPreferredSize().width,
          name.getPreferredSize().height);
      savePane.add(name);

      // Confirmation button
      confirm = new JButton(BUTTON_TEXT);
      confirm.setBounds(
          saveInsets.left + CONFIRM_X,
          saveInsets.top + CONFIRM_Y,
          confirm.getPreferredSize().width,
          confirm.getPreferredSize().height);
      confirm.addActionListener(new ConfirmActionListener());
      savePane.add(confirm);
    }
Ejemplo n.º 8
0
  public static void main(String[] args) {
    JFrame f = new JFrame("JList");
    Container contentPane = f.getContentPane();
    contentPane.setLayout(new GridLayout(1, 2));
    String[] s = {"美国", "日本", "中国", "英国", "德国"};
    Vector<String> v = new Vector<>();
    v.addElement("Nokia 8850");
    v.addElement("Nokia 8520");
    v.addElement("Motorola v8088");
    v.addElement("Motorola v3688x");
    v.addElement("Panasonic GD92");
    v.addElement("其他");

    JList<String> list1 = new JList<String>(s);
    list1.setBorder(BorderFactory.createTitledBorder("你最喜欢到那个国家玩呢?"));

    JList<String> list2 = new JList<String>(v);
    list2.setBorder(BorderFactory.createTitledBorder("你最喜欢哪一种手机呢?"));

    //		contentPane.add(list1);
    //		contentPane.add(list2);
    ////////////////////////////
    contentPane.add(new JScrollPane(list1));
    contentPane.add(new JScrollPane(list2));

    f.pack();
    f.setVisible(true);
    f.addWindowListener(
        new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent e) {
            System.exit(0);
          }
        });
  }
Ejemplo n.º 9
0
  public About() {
    cl = ClassLoader.getSystemClassLoader();

    // ----------------------------------------CENTER--------------------------------//
    imgAbout = new ImageIcon(cl.getResource("om.png"));

    lblAbout = new JLabel(imgAbout);

    lblAbout.setBounds(0, 0, 450, 263);

    JPanel pnlCenter = new JPanel();
    pnlCenter.setLayout(null);
    pnlCenter.add(lblAbout);

    btnOk = new JButton(new ImageIcon(cl.getResource("ok.png")));
    btnOk.setBounds(390, 215, 40, 30);
    pnlCenter.add(btnOk);
    btnOk.addActionListener(this);

    // -----------------------------------CONTAINER----------------------------------//
    Container c = getContentPane();
    c.setLayout(new BorderLayout());
    c.add(pnlCenter, BorderLayout.CENTER);
    setSize(450, 280);
    setVisible(true);
    setResizable(false);
    setLocation(580, 280);
    // setDefaultCloseOperation(EXIT_ON_CLOSE);

  }
Ejemplo n.º 10
0
  public void run(DataLayer pnmlData) {
    // Build interface
    JDialog guiDialog = new JDialog(CreateGui.getApp(), MODULE_NAME, true);

    // 1 Set layout
    Container contentPane = guiDialog.getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));

    // 2 Add file browser
    contentPane.add(sourceFilePanel = new PetriNetChooserPanel("Source net", pnmlData));

    // 3 Add results pane
    contentPane.add(results = new ResultsHTMLPane(pnmlData.getURI()));

    // 4 Add button
    contentPane.add(new ButtonBar("Analyse", analyseButtonClick));

    // 5 Make window fit contents' preferred size
    guiDialog.pack();

    // 6 Move window to the middle of the screen
    guiDialog.setLocationRelativeTo(null);

    guiDialog.setVisible(true);

    //    warnUser(pnmlData.getURI(), guiFrame);
    //    StateSpace stateSpace = new StateSpace(pnmlData);
  }
Ejemplo n.º 11
0
  /** *********************************************************************** */
  private static void createAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true); // give JFrame nice decorations
    JFrame frame = new JFrame("Java GUI"); // create the JFrame
    frame.setDefaultCloseOperation(
        JFrame.EXIT_ON_CLOSE); // set up the JFrame to end the program when it closes
    Container c = frame.getContentPane();
    c.setLayout(new BorderLayout());

    ColorBars drawingPanel = new ColorBars(); // set up the panel to draw in
    drawingPanel.setBackground(Color.BLACK); // the the background to black

    drawingPanel.btnDraw = new JButton("Click me"); // instantiate a swing button
    drawingPanel.btnDraw.addActionListener(drawingPanel); // register the panel with the button
    drawingPanel.btnClear = new JButton("Clear Screen");
    drawingPanel.btnClear.addActionListener(drawingPanel);

    Panel buttonPanel = new Panel(); // instantiate the panel for buttons
    buttonPanel.add(drawingPanel.btnDraw); // add the swing button the the button panel
    buttonPanel.add(drawingPanel.btnClear);

    c.add(
        drawingPanel,
        BorderLayout.CENTER); // add the drawing panel to the frame (take up the entire frame)
    c.add(buttonPanel, BorderLayout.SOUTH); // add the button panel to the bottom of the frame

    frame.setExtendedState(JFrame.MAXIMIZED_BOTH); // set the window to maximized
    frame.setSize(600, 400); // set the frame size (in case user un-maximizes
    frame.setVisible(true); // display the frame
  }
Ejemplo n.º 12
0
  public void swingMain() {

    final JCheckBox cbLocal = new JCheckBox("local");
    this.cbClass = new JCheckBox("class");

    JButton button = new JButton("print state");
    button.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            System.out.print("  cbClass.isSelected(): " + cbClass.isSelected());
            System.out.println("  cbLocal.isSelected(): " + cbLocal.isSelected());
          }
        });

    JFrame frame = new JFrame("JCheckboxDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container p = frame.getContentPane();
    p.setLayout(new FlowLayout());
    p.add(cbLocal);
    p.add(cbClass);
    p.add(button);
    frame.pack();
    frame.setVisible(true);
  }
Ejemplo n.º 13
0
  /**
   * Shows this glass box on the glass pane.
   *
   * @param glassPane the glass pane
   * @param originX the location on the X-axis to position the glass box
   * @param originY the location on the Y-axis to position the glass box
   */
  public void showOnGlassPane(Container glassPane, int originX, int originY) {
    Dimension gd = glassPane.getSize();
    Dimension bd = getPreferredSize();

    int x = Math.min(originX, gd.width - bd.width);
    int y = Math.min(originY, gd.height - bd.height);

    if (x < 0) {
      x = 0;
    }

    if (y < 0) {
      y = 0;
    }

    int width = x + bd.width < gd.width ? bd.width : gd.width;
    int height = y + bd.height < gd.height ? bd.height : gd.height;

    glassPane.setLayout(null);
    setBounds(x, y, width, height);
    glassPane.add(this);
    glassPane.setVisible(true);

    Container topLevel = getTopLevel();
    topLevel.validate();
    topLevel.repaint();
  }
Ejemplo n.º 14
0
  public static void main(String[] args) {
    JFrame frame = new JFrame("Add");
    frame.setLocation(500, 400);
    //		frame.setPreferredSize(new Dimension(250, 100));
    Container contentPane = frame.getContentPane();

    FlowLayout layout = new FlowLayout();
    contentPane.setLayout(layout);
    JPanel panel = new JPanel();
    panel.add(new JTextField(6));
    panel.add(new JLabel("+"));
    panel.add(new JTextField(6));
    panel.add(new JLabel("="));
    panel.add(new JTextField(6));

    contentPane.add(panel, BorderLayout.CENTER);

    JPanel panel2 = new JPanel();
    panel2.add(new JButton("확인"));
    panel2.add(new JButton("취소"));
    contentPane.add(panel2, BorderLayout.SOUTH);

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
  }
  stab(ResultSet k) {
    super("PATIENT FOUND");
    String[] chd = {
      "Date",
      "Patient ID",
      "Name",
      "Gender",
      "Age",
      "Weight",
      "Address",
      "Contact No.",
      "Doctor Name",
      "Symptoms",
      "Dignosis",
      "Fee: Rs.",
      "Blood Group"
    };
    // DefaultTableModel dtm=new DefaultTableModel();
    // jt.setModel(new DefaultTableModel(arr,chd));
    jt = new JTable();
    jsp = new JScrollPane(jt);
    btn = new JButton("CLOSE");
    btn.addActionListener(this);
    int i = 0;

    try {
      while (k.next()) {

        arr[i][0] = k.getString(1);
        // System.out.println("ddddddddddddd"+arr[i][0]);
        arr[i][1] = "" + k.getInt(2);
        arr[i][2] = k.getString(3) + " " + k.getString(4) + " " + k.getString(5);
        arr[i][3] = k.getString(6);
        arr[i][4] = "" + k.getInt(7);
        arr[i][5] = k.getString(8);
        arr[i][6] = k.getString(9);
        arr[i][7] = k.getString(10);
        arr[i][8] = k.getString(11);
        arr[i][9] = k.getString(12);
        arr[i][10] = k.getString(13);
        arr[i][11] = "" + k.getInt(14);
        arr[i][12] = k.getString(15);
        arr[i][13] = k.getString(16);
        // dtm.insertRow(i,new Object[]{patient.rs.getString(1),
        // patient.rs.getInt(2),patient.rs.getString(3)+patient.rs.getString(4)+patient.rs.getString(5),patient.rs.getString(6),patient.rs.getInt(7),patient.rs.getString(8),patient.rs.getString(9),patient.rs.getString(10),patient.rs.getString(11),patient.rs.getString(12),patient.rs.getString(13),patient.rs.getInt(14)});
        i++;
      }
    } catch (Exception e12) {
      System.out.println("" + e12);
    }
    jt.setModel(new DefaultTableModel(arr, chd));
    Container con = getContentPane();
    con.setLayout(null);
    jsp.setBounds(20, 20, 1230, 600);
    btn.setBounds(685, 630, 100, 30);
    add(jsp);
    add(btn);
    setSize(1330, 800);
    setVisible(true);
  }
Ejemplo n.º 16
0
  public GUITable() throws Exception {
    main_frame = new JFrame("Card Games");
    main_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    main_frame.setPreferredSize(new Dimension(357, 323));
    main_frame.setResizable(false);
    main_menu = new TableMenu();
    main_frame.setJMenuBar(main_menu);

    Container cp = main_frame.getContentPane();
    cp.setLayout(new CardLayout());
    JLabel base = new JLabel("Use the game menu to start a game");
    base.setHorizontalAlignment(SwingConstants.CENTER);
    base.setVerticalAlignment(SwingConstants.CENTER);
    cp.add(base, "Base");
    base.setSize(cp.getSize());

    main_frame.pack();
    main_frame.setVisible(true);

    game_gui = null;
    games = new Hashtable<String, TableUI>();
    this.host = GUIPlayer.getCurrentPlayer();
    if (this.host == null) {
      main_menu.showNewUserDialog(main_frame);
      this.host = GUIPlayer.getCurrentPlayer();
      if (this.host != null) main_menu.enableGameMenus();
    } else main_menu.enableGameMenus();
  }
Ejemplo n.º 17
0
  /** Initializes the GUI. */
  public void initGUI() {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    DisplayMode dm = gs[0].getDisplayMode();
    windowHeight = dm.getHeight() - 50;
    windowWidth = ((windowHeight * Board.WIDTH) / Board.HEIGHT) + MENU_WIDTH;
    this.setTitle("Kriegspiel Board Display");
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setMinimumSize(new Dimension(windowWidth, windowHeight));
    this.setResizable(false);

    Container content = this.getContentPane();

    boardPanel = new JPanel();
    boardPanel.setLayout(
        new GridLayout(Board.HEIGHT, Board.WIDTH, windowHeight / 500, windowHeight / 500));
    JPanel menuPanel = new MenuDisplayer(this, controller);
    content.setLayout(new BorderLayout());

    this.add(boardPanel, BorderLayout.CENTER);
    this.add(menuPanel, BorderLayout.EAST);

    boardPanel.setBackground(new Color(0, 0, 0));

    squares = new JPanel[Board.WIDTH][Board.HEIGHT];
  }
Ejemplo n.º 18
0
  /**
   * Shows the dialog. First a dialog must be constructed using one of the constructors of this
   * class. After that this method should be called to actually show the dialog. This method returns
   * either JOptionPane.OK_OPTION if the user wants to select his choices or
   * JOptionPane.CANCEL_OPTION if he does not want to.
   *
   * @param parent The parent frame of this dialog.
   * @return int The returnvalue, can be either JOptionPane.OK_OPTION or JOptionPane.CANCEL_OPTION
   */
  public int showDialog(Component parent) {
    Frame frame =
        parent instanceof Frame
            ? (Frame) parent
            : (Frame) SwingUtilities.getAncestorOfClass(Frame.class, parent);

    // String title = getUI().getDialogTitle(this);

    dialog = new JDialog(frame, title, true);
    Container contentPane = dialog.getContentPane();
    contentPane.setLayout(new BorderLayout());
    contentPane.add(this, BorderLayout.CENTER);

    dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    dialog.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent we) {
            cancel();
          }
        });

    dialog.pack();
    dialog.setLocationRelativeTo(parent);

    dialog.setVisible(true);
    return returnValue;
  }
Ejemplo n.º 19
0
 /**
  * Introduce the Scout449 program!
  *
  * @param stat the Scout449 responsible for this object
  */
 public Intro(Scout449 stat) {
   super("Loading Scout449");
   setVisible(false);
   setUndecorated(true);
   setIconImage(stat.getImage("winicon"));
   loadImage();
   getRootPane().putClientProperty("Window.shadow", Boolean.FALSE);
   setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
   Container c = getContentPane();
   c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));
   c.add(Box.createVerticalGlue());
   Loading load = new Loading();
   load.setOpaque(true);
   load.setAlignmentX(JComponent.CENTER_ALIGNMENT);
   c.add(load);
   setCursor(Constants.WAIT);
   c.add(Box.createVerticalGlue());
   // center the window
   Dimension ss = AppLib.winInfo.getScreenSize();
   setBounds(
       (ss.width - Constants.INTRO_WIDTH) / 2,
       (ss.height - Constants.INTRO_HEIGHT) / 2,
       Constants.INTRO_WIDTH,
       Constants.INTRO_HEIGHT);
   setVisible(true);
 }
Ejemplo n.º 20
0
  public ControlWindow(String title) {
    props = Property.getProps();

    locale = new Locale(props.getProperty("resourcebundle"));
    rb = ResourceBundle.getBundle("language", locale);

    this.setBackground(new Color(1, 1, 1));
    container = this.getContentPane();
    container.setLayout(new FlowLayout());
    container.setSize(500, 300);

    // build the window frame
    createComponents();

    this.setSize(600, 400);
    this.setLocation(300, 200);

    // Now this will set the LAF(Look & Feel)
    setLookAndFeel();
    SwingUtilities.updateComponentTreeUI(this);
    this.pack();

    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            if (monitor != null) {
              monitor.interrupt();
            }
            System.exit(0);
          }
        });

    this.setVisible(true);
  }
    public TelaCancelar() {

      Container container = getContentPane();
      container.setLayout(new FlowLayout());
      setSize(300, 125);

      setLocationRelativeTo(null);

      mensagem = new JLabel("Tem certeza que deseja cancelar o Cadastro?");

      Sim = new JButton("Sim");
      Nao = new JButton("Nao");

      Sim.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              controleTecnicos.fecharTelaTecnico();
              setVisible(false);
            }
          });

      Nao.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              setVisible(false);
            }
          });

      container.add(mensagem);
      container.add(Sim);
      container.add(Nao);
    }
Ejemplo n.º 22
0
    public void actionPerformed(ActionEvent e) {
      if (elementTreeFrame == null) {
        // Create a frame containing an instance of
        // ElementTreePanel.
        try {
          String title = resources.getString("ElementTreeFrameTitle");
          elementTreeFrame = new JFrame(title);
        } catch (MissingResourceException mre) {
          elementTreeFrame = new JFrame();
        }

        elementTreeFrame.addWindowListener(
            new WindowAdapter() {

              @Override
              public void windowClosing(WindowEvent weeee) {
                elementTreeFrame.setVisible(false);
              }
            });
        Container fContentPane = elementTreeFrame.getContentPane();

        fContentPane.setLayout(new BorderLayout());
        elementTreePanel = new ElementTreePanel(getEditor());
        fContentPane.add(elementTreePanel);
        elementTreeFrame.pack();
      }
      elementTreeFrame.setVisible(true);
    }
Ejemplo n.º 23
0
 @Override
 public void init(InstrumentPanel window) {
   Container container = window.contentPane();
   container.setLayout(new FlowLayout());
   _watchMeButton = createButton(container, "Watch Me!");
   createWatchMeButtonListener();
 }
  public Welcome() {
    c.setLayout(null);

    c.add(welcome);
    welcome.setBounds(250, 100, 600, 50);
    welcome.setFont(font1);
    welcome.setForeground(Color.black);

    c.add(hotel);
    hotel.setBounds(350, 170, 700, 50);
    hotel.setFont(font2);
    hotel.setForeground(Color.black);

    c.add(check);
    check.setBounds(450, 350, 250, 50);
    check.addActionListener(this);

    c.add(order);
    order.setBounds(150, 350, 250, 50);
    order.addActionListener(this);

    c.add(bill);
    bill.setBounds(750, 350, 250, 50);
    bill.addActionListener(this);

    c.add(exit);
    exit.setBounds(40, 600, 130, 20);
    exit.addActionListener(this);

    c.add(back).setBounds(0, 0, 1800, 1000);
  }
Ejemplo n.º 25
0
  protected void initialize() {
    this.panel = new JPanel();
    this.buttonPanel = new JPanel();
    this.okButton = new JButton(this.okCaption);
    this.cancelButton = new JButton(this.cancelCaption);

    Container c = this.getContentPane();
    c.setLayout(new BorderLayout());
    c.add(this.panel, BorderLayout.CENTER);
    c.add(this.buttonPanel, BorderLayout.SOUTH);

    this.okButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            OkCancelDialog.this.okAction(e);
          }
        });

    this.cancelButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            OkCancelDialog.this.cancelAction();
          }
        });
  }
Ejemplo n.º 26
0
  public void init() {

    // <Begin_init>
    if (initialized == true) return;
    this.setSize(getPreferredSize().width + 682, getPreferredSize().height + 419);
    setTitle(NmsClientUtil.GetString("Router Display Panel"));
    Container container = getContentPane();
    container.setLayout(new BorderLayout());
    try {
      initVariables();
      setUpGUI(container);
      setUpProperties();
      setUpConnections();
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Error in init method"), ex);
    }
    // let us set the initialzed variable to true so
    // we dont initialize again even if init is called
    initialized = true;
    setUpMenus();
    setUpToolBar();

    // <End_init>
    setIconImage(NmsClientUtil.getFrameIcon());
  }
Ejemplo n.º 27
0
  private void loadGUI() {
    setTitle("Chroma Key Sample");

    panelBottom = new JPanel();

    ButtonHandler l_buttonHandler = new ButtonHandler();
    buttonCaptureBackground = new JButton("Capture Background");
    buttonStart = new JButton("Start");
    buttonStart.setEnabled(false);
    buttonCaptureBackground.addActionListener(l_buttonHandler);
    buttonStart.addActionListener(l_buttonHandler);

    sliderColorRange = new JSlider(JSlider.HORIZONTAL, 0, 50, 30);
    sliderColorRange.setMinorTickSpacing(1);
    sliderColorRange.setPaintTicks(true);
    sliderColorRange.addChangeListener(new SliderHandler());

    labelColorRange = new JLabel("Color Range");

    panelSlider = new JPanel();
    panelSlider.add(labelColorRange);
    panelSlider.add(sliderColorRange);

    panelBottom.add(buttonCaptureBackground);
    panelBottom.add(buttonStart);

    Container l_container = getContentPane();
    l_container.setLayout(new BorderLayout());
    l_container.add(videoPanel, BorderLayout.NORTH);
    l_container.add(panelSlider, BorderLayout.CENTER);
    l_container.add(panelBottom, BorderLayout.SOUTH);

    setSize(videoInterface.getImageWidth(), videoInterface.getImageHeight() + 100);
    setVisible(true);
  }
  public CreateNeuralNetworkDialog(Frame owner) {
    super(owner);
    setTitle("Create a Network");

    this.setSize(500, 250);
    this.setLocation(50, 100);
    final Container content = getBodyPanel();
    content.setLayout(new GridLayout(1, 2));

    content.add(this.scroll1);
    content.add(this.scroll2);

    this.model.addElement("Create from Encog Factory Code");
    this.model.addElement("Automatic Perceptron from Training Set");
    this.model.addElement("ADALINE Neural Network");
    this.model.addElement("Adaptive Resonance Theory 1 (ART1)");
    this.model.addElement("Bayesian Network");
    this.model.addElement("Bidirectional Associate Memory (BAM)");
    this.model.addElement("Boltzmann Machine");
    this.model.addElement("Counterpropagation Neural Network (CPN)");
    this.model.addElement("Feedforward Neural Network");
    this.model.addElement("Feedforward - Radial Basis");
    this.model.addElement("Self Organizing Map (SOM)");
    this.model.addElement("Hopfield Neural Network");
    this.model.addElement("PNN/GRNN - Probabilistic/General Regression Neural Network");
    this.model.addElement("Recurrent - Elman");
    this.model.addElement("Recurrent - Jordan");
    this.model.addElement("Support Vector Machine (SVM)");

    this.list.addListSelectionListener(this);
    this.text.setLineWrap(true);
    this.text.setWrapStyleWord(true);
    this.text.setEditable(false);
    scroll2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  }
Ejemplo n.º 29
0
  public AboutPanel() {
    setTitle("About Panel");
    ImageIcon img = new ImageIcon("icons/preferences.jpg");
    setIconImage(img.getImage());
    Container contentPane = getContentPane();
    contentPane.setLayout(new MigLayout());

    setBackground(Color.GRAY);

    int style1 = Font.CENTER_BASELINE;
    Font font = new Font("Arial", style1, 13);

    about = new JLabel();
    about.setFont(font);
    String key = userPrefs.getRegistrationKey();
    if (key == null || key.length() == 0) {
      userPrefs.setRegistrationKey("Community Edition");
    }
    about.setText("<html>WattzAp Community Edition<br/><br/>Version 2.5.1<br/>19th August 2015");
    add(about, "alignx right, span");

    debug = new JCheckBox("Enable Debugging");
    if (userPrefs.isDebug()) {
      debug.setSelected(true);
    } else {
      debug.setSelected(false);
    }
    debug.addActionListener(this);
    add(debug);

    Dimension d = new Dimension(550, 300);
    this.setPreferredSize(d);
    pack();
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  }
Ejemplo n.º 30
0
  //	public FenetreNouveauProduit(String[] lesCategories) {
  public FenetreNouveauProduit(ControleurGestionProduit ctrlGestionProduit) {

    gp = ctrlGestionProduit;

    setTitle("Creation Produit");
    setBounds(500, 500, 200, 250);
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());

    JLabel labNom = new JLabel("Nom produit");
    JLabel labPrixHT = new JLabel("Prix Hors Taxe");
    JLabel labQte = new JLabel("Quantit� en stock");
    //		JLabel labCategorie = new JLabel("Categorie");
    contentPane.add(labNom);
    txtNom = new JTextField(15);
    contentPane.add(txtNom);
    contentPane.add(labPrixHT);
    txtPrixHT = new JTextField(15);
    contentPane.add(txtPrixHT);
    contentPane.add(labQte);
    txtQte = new JTextField(15);
    contentPane.add(txtQte);

    //		combo = new JComboBox<String>(lesCategories);
    //		combo.setPreferredSize(new Dimension(100, 20));
    //		contentPane.add(labCategorie);
    //		contentPane.add(combo);

    btValider = new JButton("Valider");
    contentPane.add(btValider);

    btValider.addActionListener(this);
    setVisible(true);
  }