Ainda não estou conseguindo … deve ser porque estou usando o Jigloo … deve ser um outro tipo …
Ainda estou precisando de ajuda … vou enviar o meu código atual:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.GroupLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.LayoutStyle;
import javax.swing.SwingConstants;
import java.awt.*;
import javax.swing.*;
/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class frmMain extends javax.swing.JFrame {
{
//Set Look & Feel
try {
javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
} catch(Exception e) {
e.printStackTrace();
}
}
private JLabel lblTitulo;
private JButton btoSobrem;
private JLabel lblMesaR;
private JLabel lblMesa;
private JLabel lblResultUm;
private JLabel lblTotUm;
private JButton btoPedCont;
private JButton btoConfPed;
private JButton btoBebidas;
private JButton btoPratos;
private JLabel jLabel5;
private JLabel jLabel4;
private JLabel jLabel3;
private JLabel jLabel2;
private JLabel jLabel1;
private JLabel lblPto;
private JButton btoRodizio;
Icon icone = new ImageIcon("pratos.gif");
/**
* Auto-generated main method to display this JFrame
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frmMain inst = new frmMain();
inst.setLocationRelativeTo(null);
inst.setVisible(true);
}
});
}
public frmMain() {
super();
initGUI();
}
private void initGUI() {
try {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setBackground(new java.awt.Color(255,255,255));
GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
getContentPane().setLayout(thisLayout);
this.setTitle("Cardápio Virtual 1.0");
pack() ;
Icon icon1 = new ImageIcon(getClass().getResource("pratos.jpg"));
{
lblTitulo = new JLabel();
lblTitulo.setText("CARDÁPIO VIRTUAL");
lblTitulo.setHorizontalAlignment(SwingConstants.CENTER);
lblTitulo.setFont(new java.awt.Font("Tahoma",1,20));
}
{
btoPratos = new JButton("boatao",icon1);
add(btoPratos);
btoPratos.setRolloverIcon(icon1);
btoPratos.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btoPratosActionPerformed(evt);
}
});
}
{
lblPto = new JLabel();
lblPto.setText("PRATOS");
lblPto.setHorizontalAlignment(SwingConstants.CENTER);
}
{
jLabel1 = new JLabel();
jLabel1.setText("RODÍZIO CARNE");
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
}
{
jLabel4 = new JLabel();
jLabel4.setText("BEBIDAS");
jLabel4.setHorizontalAlignment(SwingConstants.CENTER);
}
{
jLabel5 = new JLabel();
jLabel5.setText("SOBREMESAS");
jLabel5.setHorizontalAlignment(SwingConstants.CENTER);
}
{
jLabel2 = new JLabel();
jLabel2.setText("CONFERIR PEDIDOS");
jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
}
{
jLabel3 = new JLabel();
jLabel3.setText("PEDIR A CONTA");
jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
}
{
btoSobrem = new JButton();
btoSobrem.setText("SOBREMESAS");
btoSobrem.setFont(new java.awt.Font("Tahoma",1,16));
btoSobrem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btoSobremActionPerformed(evt);
}
});
}
{
btoRodizio = new JButton();
btoRodizio.setText("RODÍZIO CARNE");
btoRodizio.setFont(new java.awt.Font("Tahoma",1,16));
btoRodizio.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btoRodizioActionPerformed(evt);
}
});
}
{
btoBebidas = new JButton();
btoBebidas.setText("BEBIDAS");
btoBebidas.setFont(new java.awt.Font("Tahoma",1,16));
btoBebidas.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btoBebidasActionPerformed(evt);
}
});
}
{
btoConfPed = new JButton();
btoConfPed.setText("CONFERIR PEDIDOS");
btoConfPed.setFont(new java.awt.Font("Tahoma",1,16));
btoConfPed.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btoConfPedActionPerformed(evt);
}
});
}
{
btoPedCont = new JButton();
btoPedCont.setText("PEDIR A CONTA");
btoPedCont.setFont(new java.awt.Font("Tahoma",1,16));
btoPedCont.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btoPedContActionPerformed(evt);
}
});
}
{
lblTotUm = new JLabel();
lblTotUm.setText("TOTAL:");
lblTotUm.setFont(new java.awt.Font("Tahoma",1,16));
}
{
lblResultUm = new JLabel();
lblResultUm.setFont(new java.awt.Font("Tahoma",1,18));
}
{
lblMesa = new JLabel();
lblMesa.setText("MESA:");
lblMesa.setFont(new java.awt.Font("Tahoma",1,16));
}
{
lblMesaR = new JLabel();
}
thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
.addComponent(lblTitulo, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
.addGap(19)
.addGroup(thisLayout.createParallelGroup()
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
.addComponent(btoSobrem, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE)
.addGap(11))
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
.addComponent(btoPratos, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE)
.addGap(11))
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
.addGap(165)
.addComponent(jLabel5, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)))
.addComponent(lblPto, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(btoBebidas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE)
.addComponent(btoRodizio, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE))
.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(btoPedCont, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE)
.addComponent(btoConfPed, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(thisLayout.createParallelGroup()
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(lblMesaR, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE)
.addComponent(lblResultUm, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE))
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(lblTotUm, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
.addComponent(lblMesa, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)))
.addContainerGap(205, 205));
thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
.addContainerGap()
.addGroup(thisLayout.createParallelGroup()
.addComponent(lblTitulo, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 1011, GroupLayout.PREFERRED_SIZE)
.addGroup(thisLayout.createSequentialGroup()
.addGap(92)
.addGroup(thisLayout.createParallelGroup()
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
.addComponent(lblTotUm, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
.addComponent(lblResultUm, GroupLayout.PREFERRED_SIZE, 78, GroupLayout.PREFERRED_SIZE)
.addGap(230))
.addComponent(jLabel2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(btoConfPed, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(btoRodizio, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(lblPto, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(btoPratos, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE))
.addGap(74)
.addGroup(thisLayout.createParallelGroup()
.addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
.addComponent(lblMesa, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblMesaR, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE)
.addGap(197))
.addComponent(jLabel3, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(btoPedCont, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(btoBebidas, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)
.addComponent(btoSobrem, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE))
.addGap(103))));
pack();
this.setSize(1025, 703);
} catch (Exception e) {
e.printStackTrace();
}
}
private void btoSobremActionPerformed(ActionEvent evt) {
frmSobrem b = new frmSobrem();
b.setVisible(true);
this.setVisible(false);
//TODO add your code for btoPratos.actionPerformed
}
private void btoRodizioActionPerformed(ActionEvent evt) {
frmRodizio c = new frmRodizio();
c.setVisible(true);
this.setVisible(false);
//TODO add your code for btoPratos.actionPerformed
}
private void btoBebidasActionPerformed(ActionEvent evt) {
frmBebidas d = new frmBebidas();
d.setVisible(true);
this.setVisible(false);
//TODO add your code for btoPratos.actionPerformed
}
private void btoConfPedActionPerformed(ActionEvent evt) {
frmConfPed e = new frmConfPed();
e.setVisible(true);
this.setVisible(false);
//TODO add your code for btoPratos.actionPerformed
}
private void btoPedContActionPerformed(ActionEvent evt) {
frmPedCont f = new frmPedCont();
f.setVisible(true);
this.setVisible(false);
//TODO add your code for btoPratos.actionPerformed
}
private void btoPratosActionPerformed(ActionEvent evt) {
frmPratos a = new frmPratos();
a.setVisible(true);
this.setVisible(false);
//TODO add your code for btoPratos.actionPerformed
}
}
Obrigado,
Frelee