コード例 #1
0
  public LayerDesignPanel(MainFrame father) {
    this.father = father;

    this.setLayout(null);

    jsp.setBounds(10, 10, 800, 600);
    this.add(jsp);

    jspL.setBounds(820, 10, 140, 200);
    this.add(jspL);
    jl.setCellRenderer(new MyCellRenderer());

    jbSaveLayer.setBounds(820, 220, 140, 20);
    this.add(jbSaveLayer);
    jbSaveLayer.addActionListener(this);

    jbLoadLayer.setBounds(820, 250, 140, 20);
    this.add(jbLoadLayer);
    jbLoadLayer.addActionListener(this);

    jbCreate.setBounds(820, 280, 140, 20);
    this.add(jbCreate);
    jbCreate.addActionListener(this);

    jbLoadAll.setBounds(820, 310, 140, 20);
    this.add(jbLoadAll);
    jbLoadAll.addActionListener(this);

    jtfCengMing.setBounds(820, 340, 140, 20);
    this.add(jtfCengMing);
  }
コード例 #2
0
  public SurrenderUI() {
    setType(Type.UTILITY);

    ExitB = new JButton("Exit");
    ExitB.setFont(new Font("Tahoma", Font.BOLD, 12));
    ExitB.setBackground(new Color(255, 215, 0));
    ExitB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            dispose();
            new HSmain();
          }
        });
    ExitB.setBounds(461, 427, 296, 60);

    setTitle("Surrendering a Pet");
    Container pane = getContentPane();
    getContentPane().setLayout(null);
    pane.add(ExitB);

    txtSurrender = new JTextField();
    txtSurrender.setEditable(false);
    txtSurrender.setForeground(new Color(0, 0, 0));
    txtSurrender.setBackground(new Color(255, 215, 0));
    txtSurrender.setBounds(10, 11, 764, 50);
    txtSurrender.setHorizontalAlignment(SwingConstants.CENTER);
    txtSurrender.setFont(new Font("Lucida Handwriting", Font.BOLD, 18));
    txtSurrender.setText("Surrendering a Pet");
    getContentPane().add(txtSurrender);
    txtSurrender.setColumns(10);

    BackB = new JButton("Back");
    BackB.setFont(new Font("Tahoma", Font.BOLD, 12));
    BackB.setBackground(new Color(255, 215, 0));
    BackB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            new AnimalServiceUI();
            dispose();
          }
        });
    BackB.setBounds(26, 427, 320, 60);
    getContentPane().add(BackB);

    scrollPane = new JScrollPane();
    scrollPane.setBounds(0, 72, 764, 329);
    getContentPane().add(scrollPane);

    JTextPane txtSurrenderInfo = new JTextPane();
    scrollPane.setViewportView(txtSurrenderInfo);
    txtSurrenderInfo.setForeground(new Color(0, 0, 0));
    txtSurrenderInfo.setEditable(false);
    txtSurrenderInfo.setFont(new Font("Times New Roman", Font.BOLD, 15));
    txtSurrenderInfo.setText(
        "\tThe Humane Society of Lamar cannot accept every animal brought to our shelter immediately. \r\nWe respect the difficult decision of owners to relinquish their pets, and the hard choices of those \r\ngood citizens who are trying to help a stray. We accept the surrender of pets as space allows. \r\nWe maintain a waiting list for all animals needing to be admitted to the shelter.\r\nAnimals are surrendered to our facility by appointment.\r\nWe admit at least 12 animals per week. We accept more animals as adoptions and space allow.\r\nNote that we cannot accept aggressive, sick or pregnant animals.\r\nPlease call 409-225-7981, and one of our adoption specialists will speak to you.\r\nAt times our waiting list will have up to 100 animals waiting for admission and it can take several weeks \r\nbefore we can admit your pet.\r\nPlease understand that our primary goal is to place as many animals in forever homes as possible, \r\ntherefore we must give every pet admitted to the shelter enough time to find a loving home. \r\nWe cannot guarantee placement of every animal admitted to the shelter.\r\n\t\r\n\tAdmission of any animal into the Humane Society of Lamar  is based on the animal\u2019s health, \r\nbehavior, and adoptability. When you bring your pets, please have:\r\n\r\n    *Any veterinary records\r\n    *Your pet\u2019s medications\r\n    *Special food or treats that your pet needs\r\n    *Your pet\u2019s bed, toys, leash and other belongings from home\r\n\r\nA staff member will evaluate the temperament of your pet. Once your pet has been screened, \r\nand the Humane Society of Lamar decides to accept your pet, we ask a donation to our shelter to be made. \r\nThis is not required, but will greatly help us care for your pet.");

    setSize(800, 553);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  }
コード例 #3
0
  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);
  }
 public int doLayoutRetHeight() {
   Dimension sz = getSize();
   final int itemHeight = 25;
   final int itemSpacing = 5;
   final int labelWidth = 150;
   final int buttonHeight = 35;
   final int buttonWidth = 100;
   int y = itemSpacing;
   int fieldWidth = sz.width - (itemSpacing + labelWidth + itemSpacing + itemSpacing);
   int fieldX = itemSpacing + labelWidth + itemSpacing;
   int buttonSpacing = (sz.width - (buttonWidth + buttonWidth)) / 4;
   labelFileName.setBounds(itemSpacing, y, labelWidth, itemHeight);
   textFileName.setBounds(fieldX, y, fieldWidth, itemHeight);
   y = y + itemHeight + itemSpacing;
   labelLogContents.setBounds(itemSpacing, y, labelWidth, itemHeight);
   int logContentsHeight = sz.height - (y + buttonHeight + itemSpacing + itemSpacing);
   if (logContentsHeight < 100) {
     logContentsHeight = 100;
   }
   textLogContents.setBounds(fieldX, y, fieldWidth, logContentsHeight);
   y = y + logContentsHeight + itemSpacing + itemSpacing;
   buttonChooseFile.setBounds(buttonSpacing, y, buttonWidth, buttonHeight);
   buttonImportFile.setBounds(
       buttonSpacing + buttonWidth + buttonSpacing, y, buttonWidth, buttonHeight);
   buttonClose.setBounds(
       buttonSpacing + buttonWidth + buttonSpacing + buttonWidth + buttonSpacing,
       y,
       buttonWidth,
       buttonHeight);
   y = y + buttonHeight + itemSpacing + itemSpacing;
   return (y);
 }
コード例 #5
0
 public PlayGamePanel(JFrame frame, BoardConfiguration bc) {
   this.bc = bc;
   this.frame = frame;
   ImageIcon icon = new ImageIcon("ent.jpg");
   this.image = icon.getImage();
   this.one = new TransparentButton("1 Player");
   this.two = new TransparentButton("2 Players");
   this.three = new TransparentButton("3 Players");
   this.four = new TransparentButton("4 Players");
   this.setSize(frame.getSize());
   this.setLocation(0, 0);
   this.setLayout(null);
   one.setBounds(450, 140, 200, 40);
   two.setBounds(450, 200, 200, 40);
   three.setBounds(450, 260, 200, 40);
   four.setBounds(450, 320, 200, 40);
   this.add(one);
   this.add(two);
   this.add(three);
   this.add(four);
   this.back = new TransparentButton("Back");
   back.setBounds(450, 380, 200, 40);
   this.add(back);
   this.one.setFont(new Font("calibri", Font.ITALIC, 30));
   this.two.setFont(new Font("calibri", Font.ITALIC, 30));
   this.three.setFont(new Font("calibri", Font.ITALIC, 30));
   this.four.setFont(new Font("calibri", Font.ITALIC, 30));
   this.back.setFont(new Font("calibri", Font.ITALIC, 30));
   this.one.addMouseListener(this);
   this.two.addMouseListener(this);
   this.three.addMouseListener(this);
   this.four.addMouseListener(this);
   this.back.addMouseListener(this);
   this.back.setForeground(Color.red);
 }
コード例 #6
0
  public Cliente(Socket s) {
    super("OPERACIONES CON BD");
    socket = s;
    try {
      salida = new DataOutputStream(socket.getOutputStream());
      inObjeto = new ObjectInputStream(socket.getInputStream());
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(0);
    }
    setLayout(null);
    etiqueta.setBounds(10, 10, 200, 30);
    add(etiqueta);
    empconsultar.setBounds(210, 10, 50, 30);
    add(empconsultar);

    textarea1 = new JTextArea();
    scrollpane1 = new JScrollPane(textarea1);
    scrollpane1.setBounds(10, 50, 400, 300);
    add(scrollpane1);
    boton.setBounds(420, 10, 100, 30);
    add(boton);
    desconectar.setBounds(420, 50, 100, 30);
    add(desconectar);

    textarea1.setEditable(false);
    boton.addActionListener(this);
    desconectar.addActionListener(this);
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
  }
コード例 #7
0
  /**
   * Bedingungen und Positionen der Bestandteile
   *
   * @param Title Legt den Titeltext fest
   */
  public Faehigkeiten(String Title) {
    super(Title);

    text =
        new JLabel(
            "                     Manaentzug: 5XP  Lebensentzug: 10XP  Elementarmeister: 15 XP"); // Legt den ersten Text im Label fest
    text.setFont(new Font("Serif", Font.PLAIN, 14)); // Legt Schriftgroesse und Font fest
    getContentPane().add(text);

    nummer1 = new JButton("Manaentzug"); // definiert Position und Größe für die Buttons
    nummer1.setBounds(50, 170, 200, 80);
    nummer1.addActionListener(this);

    nummer2 = new JButton("Elementarmeister"); // definiert Position und Größe für die Buttons
    nummer2.setBounds(190, 400, 200, 80);
    nummer2.addActionListener(this);

    nummer3 = new JButton("Lebensentzug"); // definiert Position und Größe für die Buttons
    nummer3.setBounds(330, 170, 200, 80);
    nummer3.addActionListener(this);

    if (Board.manaleech == false) {
      add(nummer1);
    }
    if (Board.elementarmeister == false) {
      add(nummer2); // fuegt die Buttons und den Text im ersten Label zu
    }
    if (Board.lifeleech == false) {
      add(nummer3);
    }
    add(text);
  }
 public CFSecuritySwingISOCurrencyAskDeleteJPanel(
     ICFSecuritySwingSchema argSchema, ICFSecurityISOCurrencyObj argFocus) {
   super();
   final String S_ProcName = "construct-schema-focus";
   if (argSchema == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema");
   }
   // argFocus is optional; focus may be set later during execution as
   // conditions of the runtime change.
   swingSchema = argSchema;
   swingFocus = argFocus;
   // Construct the various objects
   textAreaMessage = new JTextArea("Are you sure you want to delete this ISO Currency?");
   actionOk = new ActionOk();
   actionCancel = new ActionCancel();
   buttonOk = new JButton(actionOk);
   buttonCancel = new JButton(actionCancel);
   attrJPanel = argSchema.getISOCurrencyFactory().newAttrJPanel(argFocus);
   scrollPane = new CFHSlaveJScrollPane(attrJPanel);
   // Lay out the widgets
   setSize(1024, 480);
   Dimension min = new Dimension(480, 300);
   setMinimumSize(min);
   add(textAreaMessage);
   textAreaMessage.setBounds(0, 0, 1024, 50);
   int xparts = (768 - (2 * 125)) / 3;
   add(buttonOk);
   buttonOk.setBounds(xparts, 55, 125, 40);
   add(buttonCancel);
   buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40);
   add(scrollPane);
   scrollPane.setBounds(0, 100, 1024, 480 - 100);
 }
コード例 #9
0
  public hostelStatus() {
    setTitle("Hostel");
    connect();
    updateRecord();

    JFrame fr = new JFrame();
    Toolkit tkt = fr.getToolkit();
    Dimension frsize = tkt.getScreenSize();
    setBounds(frsize.width / 4, frsize.height / 12, frsize.width / 2, frsize.height / 8);
    setLayout(null);

    cn = getContentPane();
    cn.setBackground(new Color(190, 180, 170));

    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    tl = new JLabel("Current Hostels Status");
    tl.setFont(new Font("Engravers MT", 1, 25));
    tl.setForeground(new Color(247, 251, 249));

    p1 = new JPanel();
    p1.setBounds(0, 0, 600, 50);
    p1.add(tl);
    p1.setBackground(new Color(31, 88, 166));
    cn.add(p1);

    b1 = new JButton("LOAD");
    b1.setMnemonic('L');
    b1.addActionListener(new dispListener());
    b1.setBounds(230, 320, 120, 30);

    b2 = new JButton("EXIT");
    b2.setMnemonic('X');
    b2.addActionListener(new exitListener());
    b2.setBounds(350, 320, 100, 30);

    cn.add(b1);
    cn.add(b2);

    table = new JTable(data, col);
    table.setFont(new Font("Serif", Font.BOLD, 16));
    table.setBackground(new Color(250, 250, 250));
    table.setEnabled(false);

    JScrollPane jsp = new JScrollPane(table);
    jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    jsp.setBounds(5, 100, 590, 200);
    cn.add(jsp);

    screensize = Toolkit.getDefaultToolkit().getScreenSize();

    setSize(600, 400);
    setVisible(true);
    setVisible(true);
    setResizable(true);
    connect();
  }
 public void doLayout() {
   Dimension sz = getSize();
   textAreaMessage.setBounds(0, 0, sz.width, 50);
   int xparts = (sz.width - (2 * 125)) / 3;
   buttonOk.setBounds(xparts, 55, 125, 40);
   buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40);
   scrollPane.setBounds(0, 100, sz.width, sz.height - 100);
   scrollPane.doLayout();
 }
コード例 #11
0
  /** Initialize the contents of the frame. */
  private void initialize() {
    frame = new JFrame();
    frame.setBounds(100, 100, 450, 300);
    frame.setVisible(true);
    frame.setResizable(false);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(null);

    JButton btnCustomer = new JButton("Customer");
    btnCustomer.setFont(new Font("Tahoma", Font.BOLD, 16));
    btnCustomer.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            JOptionPane.showMessageDialog(null, "Welcome to Coffee Kiosk ");
            // Coffee1 nw = new Coffee1();
            // nw.NewScreen();
            cust = cust + 1;
            Customer cs = new Customer();
            cs.CustomerScreen();
          }
        });
    btnCustomer.setBounds(83, 94, 117, 86);
    frame.getContentPane().add(btnCustomer);

    JButton btnAdmin = new JButton("Admin");
    btnAdmin.setFont(new Font("Tahoma", Font.BOLD, 16));
    btnAdmin.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, "Welcome Admin ");
            Login ls = new Login();
            ls.LoginScreen();
          }
        });

    btnAdmin.setBounds(229, 94, 117, 86);
    frame.getContentPane().add(btnAdmin);

    JButton btnExit = new JButton("EXIT");
    btnExit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            JOptionPane.showMessageDialog(null, "Thank You for using Coffee Kiosk");
            System.exit(0);
          }
        });
    btnExit.setBounds(168, 207, 89, 23);
    frame.getContentPane().add(btnExit);

    JLabel lblLeedsCoffeeKiosk = new JLabel("LEEDS COFFEE KIOSK");
    lblLeedsCoffeeKiosk.setHorizontalAlignment(SwingConstants.CENTER);
    lblLeedsCoffeeKiosk.setFont(new Font("Times New Roman", Font.BOLD | Font.ITALIC, 30));
    lblLeedsCoffeeKiosk.setForeground(new Color(148, 0, 211));
    lblLeedsCoffeeKiosk.setBounds(36, 11, 366, 72);
    frame.getContentPane().add(lblLeedsCoffeeKiosk);
  }
コード例 #12
0
ファイル: User.java プロジェクト: EtherFrog/iutjava
 private void jbInit() throws Exception {
   this.getContentPane().setLayout(null);
   Bienvenue.setFont(new java.awt.Font("Garamond", 1, 24));
   Bienvenue.setForeground(SystemColor.textHighlight);
   Bienvenue.setRequestFocusEnabled(true);
   Bienvenue.setVerifyInputWhenFocusTarget(true);
   Bienvenue.setText("Bienvenue dans JChat");
   Bienvenue.setBounds(new Rectangle(125, 28, 305, 44));
   Pseudo_L.setFont(new java.awt.Font("Dialog", 1, 14));
   Pseudo_L.setText("Pseudonyme :");
   Pseudo_L.setBounds(new Rectangle(75, 94, 128, 28));
   nom.setText("");
   nom.setBounds(new Rectangle(229, 95, 108, 24));
   pwd.setText("");
   pwd.setBounds(new Rectangle(230, 135, 108, 25));
   pwd_L.setFont(new java.awt.Font("Dialog", 1, 14));
   pwd_L.setText("Mot de passe :");
   pwd_L.setBounds(new Rectangle(76, 133, 122, 31));
   gestionnaire_B gestionnaire = new gestionnaire_B();
   Connect.addActionListener(gestionnaire);
   Connect.setBackground(new Color(239, 240, 234));
   Connect.setBounds(new Rectangle(281, 251, 142, 30));
   Connect.setText("Connexion");
   Connect.setIcon(new ImageIcon(image_c));
   Annuler.addActionListener(gestionnaire);
   Annuler.setBackground(new Color(239, 240, 234));
   Annuler.setBounds(new Rectangle(104, 252, 140, 29));
   Annuler.setText("Annuler");
   Annuler.setIcon(new ImageIcon(image_d));
   this.getContentPane().setBackground(new Color(239, 240, 234));
   this.setForeground(new Color(239, 240, 234));
   this.setTitle("Interface de connexion des clients au serveur de chat");
   jLabel1.setFont(new java.awt.Font("Dialog", 1, 14));
   jLabel1.setText("Adresse du serveur :");
   jLabel1.setBounds(new Rectangle(75, 176, 156, 26));
   jTextField1.setBounds(new Rectangle(230, 176, 108, 25));
   Icon siegle = new ImageIcon(image);
   siegle_L = new JLabel("", siegle, SwingConstants.LEFT);
   siegle_L.setBounds(new Rectangle(0, 1, 76, 105));
   this.getContentPane().add(jLabel1, null);
   this.getContentPane().add(pwd_L, null);
   this.getContentPane().add(Pseudo_L, null);
   this.getContentPane().add(jTextField1, null);
   this.getContentPane().add(nom, null);
   this.getContentPane().add(pwd, null);
   this.getContentPane().add(Bienvenue, null);
   this.getContentPane().add(Connect, null);
   this.getContentPane().add(Annuler, null);
   this.getContentPane().add(siegle_L, null);
   this.setSize(new Dimension(439, 321));
   this.setResizable(false);
   this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   this.setVisible(true);
 }
コード例 #13
0
  /*Aqui viene lo interesante*/
  public void
      Interfaz_Trabajador() // metodo que lo que hace es poner los botones y demas cosas de la GUI
                            // para ingresar Trabajadores
      {
    this.setLayout(
        null); // me permite poner donde yo quiera los botones ya que el layout no es el por defecto

    trab = new JLabel("Nombre del Trabajador");
    boton1 = new JButton("Ingresar trabajador");
    user = new JTextField(null); // campo donde se ingresa el nombre del trabajador
    id1 = new JTextField(); // campo para ingresar el id
    list = new JComboBox /*<String>*/(); // lista de trabajadores ingresados que se pueden usar
    ID = new JLabel("Numero de Identificaci�n");
    ventas = new JButton("Ingresar");
    informe = new JButton("Informe de ventas");

    trab.setBounds(
        5, 10, 130,
        9); /*localizacion del objeto. X,Y,H,W. X es la posicion en X, Y es lo mismo pero en Y.
            H y W son la altura y ancho del boton respectivamante*/
    this.add(trab); // es agregado a la ventana

    user.setBounds(138, 5, 130, 20);
    this.add(user);

    ID.setBounds(5, 40, 145, 9);
    this.add(ID);

    id1.setBounds(165, 35, 80, 20);
    this.add(id1);

    boton1.setBounds(55, 60, 150, 20);
    boton1.addActionListener(
        this); // el boton recibe la propiedad de actionListener, se le pone el daemon y si es
               // cliceado, se mandara al metodo
    this.add(boton1);

    list.setBounds(55, 100, 150, 50);
    this.add(list);

    ventas.setBounds(55, 170, 150, 20);
    ventas.addActionListener(this);
    this.add(ventas);

    informe.setBounds(55, 200, 150, 20);
    informe.addActionListener(this); // si es cliceado, se mandara al metodo
    this.add(informe);
  }
コード例 #14
0
  private void jbInit() throws Exception {
    // this.setResizable(false);
    this.setSize(ancho, alto);
    this.setLocation(0, 0);

    // this.setUndecorated(true);
    // this.getContentPane().setLayout(null);

    // limites de componentes
    labelFondo.setBounds(
        new Rectangle((int) (ancho / 5), 2 * (alto / 6), (int) (ancho / 1.5), alto / 4));
    botonCancelar.setBounds(
        new Rectangle(
            (int) (2.9 * (ancho / 5)), (int) (2 * (alto / 4)), (int) (ancho / 10.2), alto / 25));
    botonCancelar.setBorder(null);
    // botonAceptar.setBounds(new Rectangle(0, 0, 100, 30));
    botonAceptar.setBounds(
        new Rectangle(
            (int) (2.15 * (ancho / 5)), (int) (2 * (alto / 4)), (int) (ancho / 10.2), alto / 25));
    botonAceptar.setBorder(null);
    textNombre.setFont(new java.awt.Font("Serif", 3, 15));
    textNombre.setBounds(
        new Rectangle((int) (2.5 * (ancho / 5)), (int) (1.5 * (alto / 4)), ancho / 5, alto / 25));
    textNombre.addKeyListener(new PanelNick_textNombre_keyAdapter(this));

    textContra.setFont(new java.awt.Font("Serif", 3, 15));
    textContra.setBounds(
        new Rectangle(
            (int) (2.9 * (ancho / 5)), (int) (1.65 * (alto / 4)) + 20, ancho / 8, alto / 25));

    // imagenes de componentes
    labelFondo.setIcon(new ImageIcon("../imagenes/introduceNick.jpg"));
    botonCancelar.setIcon(new ImageIcon("../imagenes/botoncancelar.jpg"));
    botonCancelar.addMouseListener(new PanelNick_botonCancelar_mouseAdapter(this));
    botonAceptar.setIcon(new ImageIcon("../imagenes/botonaceptar.jpg"));
    botonAceptar.addMouseListener(new PanelNick_botonAceptar_mouseAdapter(this));

    // agregar componentes al panel
    this.add(textContra, null);
    this.add(botonCancelar, null);
    this.add(botonAceptar, null);
    this.add(textNombre, null);
    this.add(labelFondo, null);

    // acciones de botones
    botonAceptar.addActionListener(new PanelNick_botonAceptar_actionAdapter(this));
    botonCancelar.addActionListener(new PanelNick_botonCancelar_actionAdapter(this));
  }
コード例 #15
0
ファイル: PlayerPanel.java プロジェクト: Jordan2R/WarPOO2
  public PlayerPanel(ActionListener listener) {

    Dimension size;
    Insets in = this.getInsets();

    this.numberOfPlayersButtons = new ArrayList<JButton>(this.possiblePlayersAmount);
    this.colorButtons = new LinkedList<JButton>();

    label = new JLabel("Escolha a quantidade de jogadores:");
    this.add(label);

    size = label.getPreferredSize();
    label.setBounds(90, 5 + in.top, size.width, size.height);

    for (int i = 0; i < this.possiblePlayersAmount; i++) {

      JButton tempButton = new JButton(String.format("%d", i + 3));
      numberOfPlayersButtons.add(tempButton);

      size = tempButton.getPreferredSize();
      tempButton.setBounds(45 + 75 * i + in.left, 80 + in.top, size.width, size.height);
      tempButton.addActionListener(listener);

      this.add(tempButton);
    }

    this.setSize(this.getPreferredSize());
    this.setLayout(null);
    this.listener = listener;
  }
コード例 #16
0
ファイル: THA.java プロジェクト: tlulu/Tetris-Platformer
 public GameOver() {
   try {
     gameOver = new ImageIcon("gameOver.png");
   } catch (Exception e) {
   }
   back.addActionListener(this);
   name.addActionListener(this);
   sub.addActionListener(this);
   back.setBounds(325, 600, 80, 40);
   name.setBounds(325, 500, 80, 40);
   sub.setBounds(325, 700, 80, 40);
   this.setLayout(new FlowLayout(FlowLayout.CENTER, this.getWidth(), 75));
   this.add(name);
   this.add(back);
   this.add(sub);
 }
コード例 #17
0
  /**
   * Description of the Method
   *
   * @exception Exception Description of Exception
   */
  private void jbInit() throws Exception {

    this.setLayout(null);
    this.setSize(700, 500);
    this.setLocation(0, 0);

    // limites de componentes
    labelFondo.setBounds(new Rectangle((int) (ancho / 3.5), 2 * (alto / 6), ancho / 2, alto / 4));

    botonAceptar.setBounds(
        new Rectangle(
            (int) (2.4 * (ancho / 5)), (int) (1.9 * (alto / 4)), (int) (ancho / 10.2), alto / 25));
    botonAceptar.setBorder(null);

    // imagenes de componentes
    labelFondo.setIcon(new ImageIcon(Imagen));

    botonAceptar.setIcon(new ImageIcon("../imagenes/botonaceptar.jpg"));
    botonAceptar.addMouseListener(new PanelGenerico_botonAceptar_mouseAdapter(this));

    // agregar componentes al panel

    this.add(botonAceptar, null);
    this.add(labelFondo, null);
    this.setBackground(SystemColor.menuText);

    // acciones de botones
    botonAceptar.addActionListener(new PanelGenerico_botonAceptar_actionAdapter(this));
  }
コード例 #18
0
ファイル: townMap.java プロジェクト: Camtendo/jokemon
  private void setUpGui() {
    area = JokemonDriver.Area.Stringville;
    mouse = new Point();
    int thingInt = 0;
    this.setTitle("Town Map");
    this.setSize(195, 239);
    this.setResizable(false);
    this.setLayout(null);
    this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    this.setVisible(false);
    visible = false;
    this.setLocationRelativeTo(null);
    Container cp = this.getContentPane();

    JLabel map = new JLabel();
    map.setBounds(1, -5, 188, 176);
    map.setIcon(new ImageIcon(townMap.class.getResource("Logos/townmap.png")));

    closeWindow = new JButton();
    closeWindow.setText("Close Window");
    closeWindow.setBounds(0, 192, 188, 20);

    areaDisplay = new JLabel();
    areaDisplay.setText(area.toString().replace('_', ' '));
    areaDisplay.setHorizontalAlignment(JLabel.CENTER);
    areaDisplay.setBounds(0, 171, 188, 20);

    addMouseMotionListener(this);
    closeWindow.addActionListener(this);
    cp.add(map);
    cp.add(closeWindow);
    cp.add(areaDisplay);
  }
コード例 #19
0
ファイル: LoginP.java プロジェクト: vishalshar/NetMon
  public LoginP() {
    super("LOGIN");
    l1 = new JLabel("UserName");
    l2 = new JLabel("Password");
    t1 = new JTextField();
    t2 = new JPasswordField();
    d = new JTextField("r");
    b1 = new JButton("Let me in !!");

    setBounds(300, 250, 380, 240);

    l1.setBounds(20, 50, 100, 30);
    l2.setBounds(20, 90, 100, 30);
    t1.setBounds(120, 50, 150, 30);
    t1.setText("Administrator");
    t2.setBounds(120, 90, 150, 30);
    b1.setBounds(180, 130, 150, 25);
    add(l1);
    add(l2);
    add(t1);
    add(t2);
    add(b1);

    setLayout(null);
    setVisible(true);

    b1.addActionListener(this);

    setDefaultCloseOperation(EXIT_ON_CLOSE);
  }
コード例 #20
0
ファイル: Gui.java プロジェクト: demo-cards-trading-game/game
  public Gui() throws IOException {
    setSize(1024, 798);
    setBackground(Color.white);
    setTitle("Dyna-stryfe");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    addbackgound(this);
    getContentPane().setLayout(null);
    setResizable(false);
    setBackground(new Color(204, 204, 204));
    setVisible(true);

    b2 = new JButton("Play");
    b2.setBackground(Color.BLACK);
    b2.setFont(new Font("Showcard Gothic", Font.BOLD | Font.ITALIC, 11));
    b2.setForeground(Color.WHITE);
    b2.setBounds(450, 550, 132, 43);
    b2.addActionListener(this);
    add(b2);

    demo = new JLabel("<html><font color='white'>Demo version: 0.000011 </font></html>");
    demo.setBounds(870, 660, 300, 30);
    this.add(demo);

    accionarAgarreAutomatico = new JButton();
    accionarAgarreAutomatico.addActionListener(this);
  }
コード例 #21
0
 public void setBounds(int x, int y, int width, int height) {
   if (d != null) {
     if (width < d.width) width = d.width;
     if (height < d.height) height = d.height;
   }
   super.setBounds(x, y, width, height);
 }
コード例 #22
0
ファイル: Cart_Add.java プロジェクト: WickedChester/Project-1
  /** Constructor for objects of class Cart_Add */
  public Cart_Add(int itemID) {
    this.setLayout(null);
    this.setMaximumSize(new Dimension(1400, 50));
    product = invAccess.GetProductInfo(itemID);
    /** Create the DAO here */
    name = new JLabel(product.getName());
    discount = new JTextField();
    discount.setText(String.valueOf(product.getDiscount()));

    add.addActionListener(this);

    /** Absolute Positioning of the components */
    Insets insets = this.getInsets();
    /** The dimentsions of the JPanel */
    this.add(name);
    name.setBounds(25 + insets.left, 15 + insets.top, 250, 25);
    this.add(discount);
    discount.setBounds(125 + insets.left, 15 + insets.top, 75, 25);
    this.add(add);
    add.setBounds(250 + insets.left, 15 + insets.top, 85, 25);

    // this.setBorder (BorderFactory.createLineBorder(Color.black));
    product = invAccess.GetProductInfo(itemID);

    this.setVisible(true);
  }
コード例 #23
0
 private void init() throws Exception {
   this.setTitle("RasterShield Symbols");
   this.getContentPane().setLayout(null);
   treeToc1.setMap(map1);
   treeToc1.setBounds(new Rectangle(0, 52, 119, 309));
   zoomPanToolBar1.setMap(map1);
   zoomPanToolBar1.setBounds(new Rectangle(200, 5, 244, 43));
   map1.setBounds(new Rectangle(122, 51, 454, 309));
   jButton1.setBounds(new Rectangle(4, 2, 155, 48));
   jButton1.setText("Create Symbols");
   jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
   layer1.setDataset(
       "com.esri.mo2.src.file.FileSystemConnection!C:/ESRI/MOJ20/Samples/Data/USA/states.shp!");
   layer1.setBounds(new Rectangle(125, 91, 32, 32));
   layer2.setDataset(
       "com.esri.mo2.src.file.FileSystemConnection!C:/ESRI/MOJ20/Samples/Data/USA/ushigh.shp!");
   layer2.setBounds(new Rectangle(261, 153, 32, 32));
   layer3.setDataset(
       "com.esri.mo2.src.file.FileSystemConnection!C:/ESRI/MOJ20/Samples/Data/USA/capitals.shp!");
   layer3.setBounds(new Rectangle(274, 93, 32, 32));
   this.getContentPane().add(treeToc1, null);
   this.getContentPane().add(map1, null);
   this.getContentPane().add(zoomPanToolBar1, null);
   this.setSize(new Dimension(580, 363));
   map1.add(layer1, null);
   this.getContentPane().add(jButton1, null);
   map1.add(layer2, null);
   map1.add(layer3, null);
   this.setDefaultCloseOperation(EXIT_ON_CLOSE);
 }
コード例 #24
0
ファイル: SetMap.java プロジェクト: kkmehra/SE
  public void newframe() {
    JFrame frame = new JFrame("Cab Service ");
    frame.setSize(800, 600);

    frame.setVisible(true);
    // frame.setBackground(Color.CYAN);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JButton jb = new JButton("Set Name of Places ");
    jb.setBounds(100, 100, 20, 50);

    JPanel jp = new JPanel();
    jp.setBackground(Color.gray);
    jp.add(jb);
    frame.add(jp);
    JPanel jp1 = new JPanel();
    jp1.setBackground(Color.gray);
    frame.add(jp1);

    frame.add(jp);
    jb.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            try {
              CreateFrame();

            } catch (IOException ex) {
              Logger.getLogger(SetMap.class.getName()).log(Level.SEVERE, null, ex);
            }
          }
        });
  }
コード例 #25
0
  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);
  }
コード例 #26
0
ファイル: About.java プロジェクト: annsofi/kalken
  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);

  }
コード例 #27
0
ファイル: M.java プロジェクト: saraswatendra/Login-Page
  Jf() {

    j.setBounds(500, 40, 500, 500);
    j.setVisible(true);
    j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    j.setLayout(null);
    ImageIcon image = new ImageIcon("im1.jpg");
    JLabel l = new JLabel(image);
    int m = image.getIconWidth();
    int m1 = image.getIconHeight();
    j.setResizable(false); // frame resize nahi hoga	
    l.setBounds(0, 0, m, m1);
    j.add(l);
    l.add(linfo);
    l.add(lid);
    l.add(fid);
    l.add(lpass);
    l.add(fpass);
    fpass.setEchoChar('*');

    l.add(blogin);
    l.add(bnewaccount);
    l.add(bforget);

    ImageIcon image1 = new ImageIcon("logo1.png");
    JLabel limage = new JLabel(image1);
    l.add(limage);
    limage.setBounds(10, 50, 190, 130);

    Font f = new Font("ALGERIAN", Font.BOLD, 20);
    linfo.setFont(f);
    linfo.setBounds(40, 10, 420, 30);
    lid.setBounds(210, 50, 70, 30);
    fid.setBounds(290, 50, 150, 30);
    lpass.setBounds(210, 90, 70, 30);
    fpass.setBounds(290, 90, 150, 30);
    blogin.setBounds(210, 130, 100, 50);
    bnewaccount.setBounds(320, 130, 160, 20);
    bforget.setBounds(320, 160, 160, 20);
    blogin.setBackground(Color.green);
    bnewaccount.setBackground(Color.cyan);
    bforget.setBackground(Color.pink);

    blogin.addActionListener(new Login());
    bnewaccount.addActionListener(new Account());
    bforget.addActionListener(new Forget());
  }
コード例 #28
0
ファイル: ShowComp.java プロジェクト: vishalshar/NetMon
  public ShowComp() throws InterruptedException, IOException {
    super("CONNECTED COMPUTERS");
    int x = 0, d = 20;
    mb = new JMenuBar();
    File = new JMenu("File");
    mb.add(File);
    exit = new JMenuItem("Exit");
    exit.addActionListener(this);
    File.add(exit);
    ta = new JTextArea();
    ta.setBounds(20, 30, 315, 470);
    ta.setEditable(false);
    add(ta);

    setJMenuBar(mb);

    sel = new JLabel("The connected computers are..");
    sel.setBounds(15, 5, 300, 30);
    add(sel);
    b1 = new JButton("<< BACK");
    b1.setBounds(140, 510, 100, 30);
    b1.setToolTipText("Back to main page");
    b1.addActionListener(this);
    add(b1);
    setLayout(null);
    while (x < 360) {
      x = x + d;
      setBounds(675, 50, x, 600);
      this.show();
    }
    // setVisible(true);
    String s = "192.168.0.", temp = null;
    Printer printer = new Printer();
    printer.start();
    Connector connector = new Connector(printer);
    connector.start();

    LinkedList targets = new LinkedList();
    for (int i = 1; i <= 255; i++) {
      temp = s + Integer.toString(i);
      Target t = new Target(temp);
      targets.add(t);
      connector.add(t);
    }
    Thread.sleep(2000);
    connector.shutdown();
    connector.join();

    for (Iterator i = targets.iterator(); i.hasNext(); ) {
      Target t = (Target) i.next();
      if (!t.shown) t.show();
    }

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  }
コード例 #29
0
ファイル: Main.java プロジェクト: olexy/RealJava
  Main() {
    img = new ImageIcon("Indian-Railway-Network.jpg");
    imgL = new JLabel(img);
    imgL.setBounds(0, 0, 1300, 1000);
    f = new JFrame("Main");
    f.getContentPane().setLayout(null);
    f.getContentPane().setBackground(Color.green);
    b1 = new JButton("Reservation Form");
    b1.addActionListener(this);
    b1.setBounds(150, 390, 210, 60);
    b2 = new JButton("PNR-enquiry");
    b2.addActionListener(this);
    b2.setBounds(150, 490, 210, 60);
    b3 = new JButton("Cancellation Form");
    b3.addActionListener(this);
    b3.setBounds(580, 390, 210, 60);
    b4 = new JButton("Exit");
    b4.addActionListener(this);
    b4.setBounds(580, 490, 210, 60);

    b1.setBackground(new Color(100, 200, 0));
    b1.setForeground(new Color(255, 255, 255));
    b2.setBackground(new Color(100, 200, 0));
    b2.setForeground(new Color(255, 255, 255));
    b3.setBackground(new Color(100, 200, 0));
    b3.setForeground(new Color(255, 255, 255));
    b4.setBackground(new Color(100, 200, 0));
    b4.setForeground(new Color(255, 255, 255));

    b1.setMnemonic('R');
    b2.setMnemonic('P');
    b3.setMnemonic('C');
    b4.setMnemonic('E');

    f.getContentPane().add(b1);
    f.getContentPane().add(b2);
    f.getContentPane().add(b3);
    f.getContentPane().add(b4);
    f.getContentPane().add(imgL);
    f.setSize(1300, 1000);
    f.setVisible(true);
  }
コード例 #30
0
  /**
   * The GPropertiesDialog class constructor.
   *
   * @param gui the GUI class
   */
  public GPropertiesDialog(GUI gui) {
    // superclass constructor
    super(gui, "Properties", false);
    objects = new ObjectContainer();

    // gui
    this.gui = gui;

    // set the fixed size
    setSize(260, 350);
    setResizable(false);
    setLayout(null);

    // set up panels for stuff
    pane = new JTabbedPane();

    // add the tabbed panel
    tabbedPanePanel = new JPanel();
    tabbedPanePanel.add(pane);
    tabbedPanePanel.setLayout(null);
    this.getContentPane().add(tabbedPanePanel);
    tabbedPanePanel.setBounds(0, 0, this.getWidth(), 280);
    pane.setBounds(0, 0, tabbedPanePanel.getWidth(), tabbedPanePanel.getHeight());

    // set up buttons
    apply = new JButton("Apply");
    apply.setBounds(150, 290, 80, 26);
    this.getContentPane().add(apply);

    close = new JButton("Close");
    close.setBounds(50, 290, 80, 26);
    this.getContentPane().add(close);

    addPanel(new GPropertiesPanelCustomObject(gui.getGMap()), "Object");

    // add listeners
    addMouseListener(this);
    apply.addItemListener(this);
    apply.addActionListener(this);
    close.addItemListener(this);
    close.addActionListener(this);
  }