473,750 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I get the error DelegatingMetho dAccessor when i run this code from AlphaApp

18 New Member
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
Expand|Select|Wrap|Line Numbers
  1. import java.awt.*;
  2. import java.io.*;
  3. import java.util.*;
  4. import java.net.*;
  5. import javax.swing.*;
  6. import java.awt.event.*;
  7. import java.awt.FlowLayout.*;
  8.  
  9. public class MainMenu extends JPanel
  10. {
  11.    static JLabel title, advert;
  12.    static JButton addBooks, addSoftware, addProduct, viewCart, makeOrder;
  13.    static JPanel manuPanel; 
  14.    static CardLayout cardLayout; 
  15.    static FlowLayout flowLayout;
  16.  
  17.  
  18.    static public ArrayList<Order> orderHistory = new ArrayList<Order>();
  19.    static public ArrayList<Book> bookList = new ArrayList<Book>();
  20.    static public ArrayList<Cart> cart = new ArrayList<Cart>();
  21.    static public ArrayList<Software> softwareList = new ArrayList<Software>();
  22.  
  23.    @SuppressWarnings("unchecked") //  gets rid of the unchecked or unsafe warning
  24.    public MainMenu(){                    
  25.        final String dir = System.getProperty("user.dir");
  26.        Color Gray = new Color(1,1,1); 
  27.        Color titleColor = new Color(1,1,1);
  28.  
  29.        setLayout(new FlowLayout());       
  30.        manuPanel = new JPanel(new FlowLayout());
  31.  
  32.        addBooks = new JButton("ADD BOOKS");
  33.        addBooks.setLocation (30,450);//(30,450);
  34.        addBooks.setSize(80,40);
  35.         add(addBooks);
  36.  
  37.        addSoftware = new JButton("ADD SOFTWARE");
  38.        addSoftware.setLocation(30,451);
  39.        addSoftware.setSize(80,40);
  40.         add(addSoftware);       
  41.  
  42.        makeOrder = new JButton("MAKE ORDER");
  43.        makeOrder.setLocation(30,452);
  44.        makeOrder.setSize(80,40);
  45.         add(makeOrder);
  46.  
  47.        viewCart = new JButton("VIEW CART");
  48.        viewCart.setLocation(30,453);
  49.        viewCart.setSize(80,40);
  50.         add(viewCart);
  51.  
  52.          addBooks.addActionListener(new ActionListener()
  53.          {
  54.             public void actionPerformed(ActionEvent evt)
  55.             {
  56.                 Product bookID = new Product();       //int productID = bookID.getproductID();          
  57.                AlphaApp.cardLayout.show(AlphaApp.cards, "Add Books");
  58.             }
  59.         });
  60.  
  61.         addSoftware.addActionListener(new ActionListener()
  62.         {
  63.             public void actionPerformed(ActionEvent evt)
  64.             {
  65.  
  66.               AlphaApp.cardLayout.show(AlphaApp.cards, "Add Softwares");
  67.             }
  68.         });
  69.  
  70.  
  71.         makeOrder.addActionListener(new ActionListener()
  72.         {
  73.             public void actionPerformed(ActionEvent evt)
  74.             {  
  75.                 AlphaApp.window.setSize(1200,800);
  76.                 AlphaApp.window.setResizable(false);
  77.                 AlphaApp.window.setLocationRelativeTo(null);  
  78.                 AlphaApp.makeOrderCard.book.setSelected(true);
  79.                 AlphaApp.makeOrderCard.updateBookTable();
  80.                 AlphaApp.cardLayout.show(AlphaApp.cards, "Make Order");              
  81.             }
  82.         });
  83.  
  84.         viewCart.addActionListener(new ActionListener()
  85.         {
  86.             public void actionPerformed(ActionEvent evt)
  87.             {
  88.         boolean emptyRow = AlphaApp.viewCartCard.historyTable.getSelectedRowCount() > 0;
  89.         if(!emptyRow){
  90.            AlphaApp.viewCartCard.populateHistoryTable();               
  91.         }else{
  92.             JOptionPane.showMessageDialog(null, "MAKE AN ORDER!", "Information", JOptionPane.WARNING_MESSAGE);
  93.         }
  94.                 AlphaApp.window.setSize(1000,600);
  95.                 AlphaApp.window.setLocationRelativeTo(null);     
  96.                 //AlphaApp.viewCartCard.updateCartTable();
  97.                 //AlphaApp.viewCartCard.updateOrderTable();       
  98.                 //AlphaApp.viewCartCard.populateHistoryTable(); 
  99.                 AlphaApp.cardLayout.show(AlphaApp.cards, "View Cart");              
  100.             }
  101.         });
  102.  
  103.  
  104.  
  105.         add(manuPanel);
  106.         manuPanel.add(addBooks, "split 2, gapTop 130, gapRight 65"); 
  107.         manuPanel.add(addSoftware, "gapTop 130, wrap");     
  108.         manuPanel.add(makeOrder, "split 2, gapTop 50, gapRight 60");   
  109.         manuPanel.add(viewCart, " sg a, wrap, gapTop 50");     
  110.  
  111.  
  112. }
  113.  
AlphaApp
Expand|Select|Wrap|Line Numbers
  1. import java.awt.*;
  2. import javax.swing.*;
  3.  
  4. public class AlphaApp extends JFrame
  5. {
  6.     static JFrame window;    
  7.     static public CardLayout cardLayout;    
  8.     static public JPanel cards;  
  9.  
  10.     MainMenu menu = new MainMenu();
  11.  
  12.     static public AddBooks addBooks = new AddBooks();
  13.     static public AddSoftware addSoftwares = new AddSoftware();
  14.     static public MakeOrder makeOrderCard = new MakeOrder();
  15.     static public ViewCart viewCartCard = new ViewCart();
  16.  
  17.  
  18.     public static void main(String [] args){
  19.         try {  
  20.                 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
  21.  
  22.             }  
  23.             catch (Exception ex1){}
  24.  
  25.        AlphaApp app = new AlphaApp();   
  26.     }
  27.  
  28.     public AlphaApp(){        
  29.         window = new JFrame("");
  30.         window.setSize(800,600);
  31.         window.setLocationRelativeTo(null);    // trying to center the window
  32.         //window.setMinimumSize(new Dimension(400, 400)); // frame size
  33.         window.setResizable(true);  
  34.  
  35.  
  36.         cardLayout = new CardLayout();  // PANELS     
  37.         cards = new JPanel(cardLayout);   //PANELS
  38.  
  39.  
  40.  
  41.  
  42.         window.add(cards);
  43.         cards.add(menu, "Main Menu");
  44.         cards.add(addBooks, "Add Books");
  45.         cards.add(addSoftwares, "Add Softwares");
  46.         cards.add(makeOrderCard, "Make Order");
  47.         cards.add(viewCartCard, "View Cart");
  48.  
  49.         cardLayout.show(cards, "Main Menu");
  50.         window.setVisible(true);
  51.     }
  52.  
  53.  
  54. }
  55.  
Oct 3 '15 #1
0 935

Sign in to post your reply or Sign up for a free account.

Similar topics

5
7042
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 :
4
2950
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" %>
4
1737
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
4
13009
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
4
3043
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...
1
1805
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.
2
8819
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...
10
5867
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...
9
10150
whatelyb
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
0
8836
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,...
0
9394
jinu1996
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...
0
9256
tracyyun
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...
0
8260
agi2029
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...
0
6080
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();...
0
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.