atsun.reflect.D elegatingMethod AccessorImpl.in voke(Delegating MethodAccessorI mpl.java:43)
at java.lang.refle ct.Method.invok e(Method.java:4 97)
at bluej.runtime.E xecServer$3.run (ExecServer.jav a:730) MainMenu - import java.awt.*;
-
import java.io.*;
-
import java.util.*;
-
import java.net.*;
-
import javax.swing.*;
-
import java.awt.event.*;
-
import java.awt.FlowLayout.*;
-
-
public class MainMenu extends JPanel
-
{
-
static JLabel title, advert;
-
static JButton addBooks, addSoftware, addProduct, viewCart, makeOrder;
-
static JPanel manuPanel;
-
static CardLayout cardLayout;
-
static FlowLayout flowLayout;
-
-
-
static public ArrayList<Order> orderHistory = new ArrayList<Order>();
-
static public ArrayList<Book> bookList = new ArrayList<Book>();
-
static public ArrayList<Cart> cart = new ArrayList<Cart>();
-
static public ArrayList<Software> softwareList = new ArrayList<Software>();
-
-
@SuppressWarnings("unchecked") // gets rid of the unchecked or unsafe warning
-
public MainMenu(){
-
final String dir = System.getProperty("user.dir");
-
Color Gray = new Color(1,1,1);
-
Color titleColor = new Color(1,1,1);
-
-
setLayout(new FlowLayout());
-
manuPanel = new JPanel(new FlowLayout());
-
-
addBooks = new JButton("ADD BOOKS");
-
addBooks.setLocation (30,450);//(30,450);
-
addBooks.setSize(80,40);
-
add(addBooks);
-
-
addSoftware = new JButton("ADD SOFTWARE");
-
addSoftware.setLocation(30,451);
-
addSoftware.setSize(80,40);
-
add(addSoftware);
-
-
makeOrder = new JButton("MAKE ORDER");
-
makeOrder.setLocation(30,452);
-
makeOrder.setSize(80,40);
-
add(makeOrder);
-
-
viewCart = new JButton("VIEW CART");
-
viewCart.setLocation(30,453);
-
viewCart.setSize(80,40);
-
add(viewCart);
-
-
addBooks.addActionListener(new ActionListener()
-
{
-
public void actionPerformed(ActionEvent evt)
-
{
-
Product bookID = new Product(); //int productID = bookID.getproductID();
-
AlphaApp.cardLayout.show(AlphaApp.cards, "Add Books");
-
}
-
});
-
-
addSoftware.addActionListener(new ActionListener()
-
{
-
public void actionPerformed(ActionEvent evt)
-
{
-
-
AlphaApp.cardLayout.show(AlphaApp.cards, "Add Softwares");
-
}
-
});
-
-
-
makeOrder.addActionListener(new ActionListener()
-
{
-
public void actionPerformed(ActionEvent evt)
-
{
-
AlphaApp.window.setSize(1200,800);
-
AlphaApp.window.setResizable(false);
-
AlphaApp.window.setLocationRelativeTo(null);
-
AlphaApp.makeOrderCard.book.setSelected(true);
-
AlphaApp.makeOrderCard.updateBookTable();
-
AlphaApp.cardLayout.show(AlphaApp.cards, "Make Order");
-
}
-
});
-
-
viewCart.addActionListener(new ActionListener()
-
{
-
public void actionPerformed(ActionEvent evt)
-
{
-
boolean emptyRow = AlphaApp.viewCartCard.historyTable.getSelectedRowCount() > 0;
-
if(!emptyRow){
-
AlphaApp.viewCartCard.populateHistoryTable();
-
}else{
-
JOptionPane.showMessageDialog(null, "MAKE AN ORDER!", "Information", JOptionPane.WARNING_MESSAGE);
-
}
-
AlphaApp.window.setSize(1000,600);
-
AlphaApp.window.setLocationRelativeTo(null);
-
//AlphaApp.viewCartCard.updateCartTable();
-
//AlphaApp.viewCartCard.updateOrderTable();
-
//AlphaApp.viewCartCard.populateHistoryTable();
-
AlphaApp.cardLayout.show(AlphaApp.cards, "View Cart");
-
}
-
});
-
-
-
-
add(manuPanel);
-
manuPanel.add(addBooks, "split 2, gapTop 130, gapRight 65");
-
manuPanel.add(addSoftware, "gapTop 130, wrap");
-
manuPanel.add(makeOrder, "split 2, gapTop 50, gapRight 60");
-
manuPanel.add(viewCart, " sg a, wrap, gapTop 50");
-
-
-
}
-
AlphaApp - import java.awt.*;
-
import javax.swing.*;
-
-
public class AlphaApp extends JFrame
-
{
-
static JFrame window;
-
static public CardLayout cardLayout;
-
static public JPanel cards;
-
-
MainMenu menu = new MainMenu();
-
-
static public AddBooks addBooks = new AddBooks();
-
static public AddSoftware addSoftwares = new AddSoftware();
-
static public MakeOrder makeOrderCard = new MakeOrder();
-
static public ViewCart viewCartCard = new ViewCart();
-
-
-
public static void main(String [] args){
-
try {
-
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
-
-
}
-
catch (Exception ex1){}
-
-
AlphaApp app = new AlphaApp();
-
}
-
-
public AlphaApp(){
-
window = new JFrame("");
-
window.setSize(800,600);
-
window.setLocationRelativeTo(null); // trying to center the window
-
//window.setMinimumSize(new Dimension(400, 400)); // frame size
-
window.setResizable(true);
-
-
-
cardLayout = new CardLayout(); // PANELS
-
cards = new JPanel(cardLayout); //PANELS
-
-
-
-
-
window.add(cards);
-
cards.add(menu, "Main Menu");
-
cards.add(addBooks, "Add Books");
-
cards.add(addSoftwares, "Add Softwares");
-
cards.add(makeOrderCard, "Make Order");
-
cards.add(viewCartCard, "View Cart");
-
-
cardLayout.show(cards, "Main Menu");
-
window.setVisible(true);
-
}
-
-
-
}
-
0 926 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Patrice FRITSCH |
last post by:
I'm trying to run a batch file from an asp page using WScript.Shell object.
Dim oWSH
set oWSH= Server.CreateObject("WScript.Shell")
call oWSH.Run("cmd.exe /c " & szCmd , 0, true)
szCmd contains the program to execute (fop.bat with several parameters).
But I'm getting the following error message :
|
by: Mark |
last post by:
Not sure this is the right place for this questions, but here goes:
I get an error message when deleting an table from a Access database.
The code is as follows and the error message is after it.
***************** Start Code ********************
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Oledb" %>
|
by: John |
last post by:
Hi all;
I write my first code using vector and list. When I run it,
segmentation fault.
Try to debug it, but it can not pass linking with -g option.
What is the error with it?
Thanks a lot.
John
|
by: OutdoorGuy |
last post by:
Greetings,
I am attempting to compile the code below, but I am receiving an error
message when I do so. The error message is: "CSO161:
'Forloop.CalcAvg(int)': Not all code paths return a value". Any idea as
to what I'm doing wrong? I'm sure it's something simple.
Thanks in advance!
public class ForLoop
|
by: Al Santino |
last post by:
Hello,
I've created a simple C# web services project using Visual Studio 2005. My
service compiles and runs correctly when called by remote clients.
I'm able to step through the service in the debugger unless I add a
Global.asax file. When I do that and then try to run the debugger I receive
error 403. If I remove the Global.asax file things work fine. The
Global.asax file is the one generated by VS 2005 - I don't try to add
anything...
| |
by: Nathan Sokalski |
last post by:
When I click after about 15 minutes on a page I wrote I recieve the
following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Validation of viewstate MAC failed. If this application is hosted by a Web
Farm or cluster, ensure that <machineKeyconfiguration specifies the same
validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.
|
by: LeoK |
last post by:
After finally completing my database I was ready to transfer it to our client, but when the access database was opened, everything works great, except for the SEND_EMAIL part, whenever any code that has to do with opening outlook I get a error, . I panic, so I try it on another computer and the same thing happened. After further investigation I realize that on both machine outlook wasn't set up yet, meaning no account existed. My only question...
|
by: surferj |
last post by:
I am beginning to receive an error message when trying to execute the .Send command when using the CDO.Configuration and CDO.Message in a W2k3 server environment on WXP machines and IE6. Below is a sample of the code i am using but when attempting to modify existing code or create a new page using this code i receive an error in the .Send line in IE. I will paste the error message when i return to work but basically states error executing...
|
by: whatelyb |
last post by:
I am having trouble related to the attached coding.
I am trying to make the object "flight1pic" change depending on what is selected in the drop down menus "airline1" and "aircraft1".
My problem is when changing "airline1" it all works fine, but when changing "aircraft1" i get the error:
Line: 1
Char: 1
Error: Object Expected
Code: 0
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |