• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

link from the main menu to other

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how do i link the customer, invoice, inventory, order and product to their individual page?
let's day the name is InventoryWin, CustomerWin, InvoiceWin, OrderWin and ProductWin.

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MainMenu extends JFrame implements ActionListener
{
public static void main(String args[]){
MainMenu m = new MainMenu();
m.setVisible(true);
}
JLabel mainLabel;
JButton custBtn;
JButton orderBtn;
JButton invoiceBtn;
JButton inventBtn;
JButton productBtn;
JButton exitBtn;
JPanel pane1;
public MainMenu(){
super("Main Menu");
setSize(new Dimension(500, 700));
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container c = this.getContentPane();
c.setLayout(new FlowLayout(FlowLayout.CENTER));
pane1 = new JPanel(new GridLayout(7,1, 30,50));
mainLabel = new JLabel("Main Menu");
mainLabel.setFont(new Font("TimesRoman",Font.BOLD,18));
mainLabel.setForeground(Color.black);
custBtn = new JButton("Customer");
orderBtn = new JButton("Order");
invoiceBtn = new JButton("Invoice");
inventBtn = new JButton("Inventory");
productBtn = new JButton("Product");
exitBtn = new JButton("Exit");

custBtn.addActionListener(this);
orderBtn.addActionListener(this);
invoiceBtn.addActionListener(this);
inventBtn.addActionListener(this);
productBtn.addActionListener(this);
exitBtn.addActionListener(this);

pane1.add(mainLabel);
pane1.add(custBtn);
pane1.add(orderBtn);
pane1.add(invoiceBtn);
pane1.add(inventBtn);
pane1.add(productBtn);
pane1.add(exitBtn);
c.add(pane1);
}
public void actionPerformed(ActionEvent e){
}
}
 
I will suppress my every urge. But not this shameless plug:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic