Ejemplo n.º 1
0
  public IUmenu(String host) {

    setTitle("GUUERRA_NAVAL");
    efectos = new Efectos();
    try {
      cliente = new Cliente(host);
    } catch (Exception ex) {
    }

    /* Titulo */
    titulo = new JLabel(" JHONMAN ");
    titulo.setForeground(Color.BLACK);
    titulo.setFont(new Font("Algerian", Font.BOLD, 24));
    titulo.setBounds(120, 40, 560, 40);
    titulo.setHorizontalAlignment(JLabel.CENTER);

    /* MeEnu de Opciones */
    mEnU = new JLabel("MENU DE OPCIONES");
    mEnU.setForeground(Color.BLACK);
    mEnU.setFont(new Font("Algerian", Font.BOLD, 24));
    mEnU.setBounds(40, 135, 390, 40);
    mEnU.setHorizontalAlignment(JLabel.LEFT);

    ImageIcon i = new ImageIcon("imagenes/apariencia/fondo_def.jpg");
    fondo = new JLabel(new ImageIcon(i.getImage().getScaledInstance(800, 600, Image.SCALE_SMOOTH)));
    fondo.setBounds(0, 0, 800, 600);

    ImageIcon i1 = new ImageIcon("imagenes/apariencia/botRegistrar.jpg");
    ImageIcon i2 = new ImageIcon("imagenes/apariencia/botPrincipiante.jpg");
    ImageIcon i3 = new ImageIcon("imagenes/apariencia/botDificil.jpg");
    ImageIcon i4 = new ImageIcon("imagenes/apariencia/botSalir.jpg");
    ImageIcon i5 = new ImageIcon("imagenes/apariencia/botRaking.jpg");
    ImageIcon i6 = new ImageIcon("imagenes/apariencia/brJuegoRed2.jpg");
    ImageIcon i11 = new ImageIcon("imagenes/apariencia/botRegistrar2.jpg");
    ImageIcon i22 = new ImageIcon("imagenes/apariencia/botPrincipiante2.jpg");
    ImageIcon i33 = new ImageIcon("imagenes/apariencia/botDificil2.jpg");
    ImageIcon i44 = new ImageIcon("imagenes/apariencia/botSalir2.jpg");
    ImageIcon i55 = new ImageIcon("imagenes/apariencia/botRaking2.jpg");
    ImageIcon i66 = new ImageIcon("imagenes/apariencia/brJuegoRed.jpg");

    /* Boton Puntajes */
    estad =
        new JButton(new ImageIcon(i5.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    estad.setBounds(98, 148, 170, 40);
    estad.setRolloverIcon(
        new ImageIcon(
            i55.getImage()
                .getScaledInstance(
                    170,
                    40,
                    Image
                        .SCALE_SMOOTH))); // cuando el mouse esta sobre el boton cambia a esta
                                          // imagen
    estad.setBorderPainted(false); // elimino los bordes de el boton
    estad.addActionListener(this);
    estad.setMnemonic(KeyEvent.VK_P);
    estad.setToolTipText("ver Raking ALT + P");

    /* Boton Registrar */
    registrar =
        new JButton(new ImageIcon(i1.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    registrar.setBounds(98, 205, 170, 40);
    registrar.setRolloverIcon(
        new ImageIcon(i11.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    registrar.setBorderPainted(false);
    registrar.addActionListener(this);
    registrar.setMnemonic(KeyEvent.VK_Q);
    registrar.setToolTipText("Registrarse ALT + Q");

    /* Boton TipoFacil */
    facil =
        new JButton(new ImageIcon(i2.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    facil.setBounds(97, 262, 170, 40);
    facil.setRolloverIcon(
        new ImageIcon(i22.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    facil.setBorderPainted(false);
    facil.addActionListener(this);
    facil.setMnemonic(KeyEvent.VK_F);
    facil.setToolTipText("jugar en modo principiante ALT + F");

    /* Boton TipoDificil */
    dific =
        new JButton(new ImageIcon(i3.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    dific.setBounds(97, 317, 170, 40);
    dific.setRolloverIcon(
        new ImageIcon(i33.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    dific.setBorderPainted(false);
    dific.addActionListener(this);
    dific.setMnemonic(KeyEvent.VK_D);
    dific.setToolTipText("jugar en modo dificil ALT + D");

    /* Boton Salir */
    salir =
        new JButton(new ImageIcon(i4.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    salir.setBounds(97, 430, 170, 40);
    salir.setRolloverIcon(
        new ImageIcon(i44.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    salir.setBorderPainted(false);
    salir.addActionListener(this);
    salir.setMnemonic(KeyEvent.VK_S);
    salir.setToolTipText("Salir ALT + S");

    /* Boton Red */
    red = new JButton(new ImageIcon(i6.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    red.setBounds(97, 374, 170, 40);
    red.setRolloverIcon(
        new ImageIcon(i66.getImage().getScaledInstance(170, 40, Image.SCALE_SMOOTH)));
    red.setBorderPainted(false);
    red.addActionListener(this);
    red.setMnemonic(KeyEvent.VK_C);
    red.setToolTipText("Jugar con varios jugadores ALT + C");

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

    c.add(titulo);
    c.add(estad);
    c.add(facil);
    c.add(registrar);
    c.add(dific);
    c.add(salir);
    c.add(red);
    c.add(fondo);
  }
Ejemplo n.º 2
0
  public SmartToolBar(RuntimeConfigFrame fr) {
    frame = fr;
    setFloatable(true);
    treeCombo = new TreeCombo(frame.model);
    treeCombo.addActionListener(new ComboListener());
    treeCombo.setPreferredSize(new Dimension(210, 25));
    treeCombo.setMinimumSize(new Dimension(210, 25));
    treeCombo.setMaximumSize(new Dimension(210, 25));
    add(treeCombo);
    addSeparator();
    addSeparator();
    addSeparator();

    ToolBarAction toolBarAction = new ToolBarAction();
    JButton saveAsButton = add(toolBarAction);
    ImageIcon icon =
        frame
            .getCommonBuilderUIImpl()
            .getScaledImage("file.png", "images/runtimeadmin", 28, 28, Image.SCALE_DEFAULT);
    saveAsButton.setPreferredSize(new Dimension(28, 28));
    saveAsButton.setMinimumSize(new Dimension(28, 28));
    saveAsButton.setMaximumSize(new Dimension(28, 28));
    saveAsButton.setBorderPainted(false);
    saveAsButton.setIcon(icon);
    icon =
        frame
            .getCommonBuilderUIImpl()
            .getScaledImage("file_mo.png", "images/runtimeadmin", 28, 28, Image.SCALE_DEFAULT);
    saveAsButton.setRolloverIcon(icon);
    saveAsButton.setActionCommand("Apply To Server");
    saveAsButton.setToolTipText(RuntimeConfigFrame.getString("Apply To Server"));
    addSeparator();

    JButton close = add(toolBarAction);
    icon =
        frame
            .getCommonBuilderUIImpl()
            .getScaledImage("exit.png", "images/", 28, 28, Image.SCALE_DEFAULT);
    close.setPreferredSize(new Dimension(28, 28));
    close.setMinimumSize(new Dimension(28, 28));
    close.setMaximumSize(new Dimension(28, 28));
    close.setIcon(icon);
    close.setBorderPainted(false);
    icon =
        frame
            .getCommonBuilderUIImpl()
            .getScaledImage("exit_mo.png", "images/", 28, 28, Image.SCALE_DEFAULT);
    close.setRolloverIcon(icon);
    close.setActionCommand("Close");
    close.setToolTipText(RuntimeConfigFrame.getString("Close"));
    addSeparator();

    JButton help = add(toolBarAction);
    icon =
        frame
            .getCommonBuilderUIImpl()
            .getScaledImage("toolhelp.png", "images/", 28, 28, Image.SCALE_DEFAULT);
    help.setPreferredSize(new Dimension(28, 28));
    help.setMinimumSize(new Dimension(28, 28));
    help.setMaximumSize(new Dimension(28, 28));
    help.setBorderPainted(false);
    help.setIcon(icon);

    icon =
        frame
            .getCommonBuilderUIImpl()
            .getScaledImage("toolhelp_mo.png", "images/", 28, 28, Image.SCALE_DEFAULT);
    help.setRolloverIcon(icon);
    help.setActionCommand("Help Contents");
    help.setToolTipText(RuntimeConfigFrame.getString("Help"));
    // addSeparator();

  }