Cannot Display Menu Using Derby
Apr 15, 2014
ok so I am trying to create a movie rental database. I want to show a list of movies, customers, and rentals. my problem is that I cant run everything but I keep getting the following error :
ERROR: Table/View 'MOVIES' does not exist.
Here is my code
import java.sql.*;
import java.util.Scanner;
public class MovieRentalDB
{
public static void main(String[] args)
[code]....
the program runs but I keep getting that error. I know my code is also not complete but I will do the rest once I figure out why my tables are not creating
View Replies
ADVERTISEMENT
Aug 14, 2014
I want to read json file as follow;
{
"M": {
"row": [
{
"col1": "c00"
},
{
"col1": "c10",
"col2": "c11"
},
{
"col1": "c20",
"col2": "c21",
"col3": "c22"
}
]
}
}
Next to reading I need to assign to two dimensional array, but without giving "col1","col2","col3" a lot.
The array is for example, Array[3][] = {{"c00"},{"c10","c11"},{"c20","c21","c22"}};
View Replies
View Related
May 12, 2014
I'm trying to create a GUI java application.
I want a menu with buttons that looks like this:
Button 1: Start
Button 2: Help
Button 3: About Me
If you press one of the buttons you will get to another frame with new buttons, new labels and so on.
Next step for instance if you press button 1, I'd like my program to get this frame:
Different alternatives, and a text field with a button. One commando leads to one new JFrame with new buttons, text fields and so on.
View Replies
View Related
Nov 17, 2014
I want to create a dropdown menu with contents from a database. You can see my Code in the attachment. It does not work, but why? I have a dropdown-symbol, but no contents.
View Replies
View Related
Apr 23, 2014
I have a GUI with a menu to do various options. However I want to change that menu to use buttons instead. I'm working with JSwing components and I'm a little familiar with the JButton function, but I don't know how to convert the menu to a button. I think I'll have to remove the menu completely..anyway I tried to start with the file menu but the compiler says no suitable method found for setForeground(javax.swing.JMenu). Why is it giving me an error related to JMenu when I'm using Jbutton objects? Can I not use JButton objects inside a menubar scope? I'll bold the area it highlighted:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
[Code]...
View Replies
View Related
Dec 3, 2014
I am working on implementing a stack using a linked list. Programming the stack operations (push, pop, isEmpty, etc.) was easy but my directions were to provide the user with a menu to choose the operation that he/she wishes to perform. I am new to JFrames/Menus so how to make the stack operations available in a menu.
View Replies
View Related
Nov 8, 2014
I am making an edit page and I want to populate my drop down menu with things that were already selected. For example, if i want i click to edit my favorite food it will be populated with the one the user previously selected. How do i go about doing this? [URL] ....
View Replies
View Related
Sep 29, 2014
I have an assignment that I need to create a menu like this using only arrays.
Main Menu:
1. Input how many students.
2. Input names and grades
3. Print name and grades.
4. Exit
I dont know how to do them in array.
View Replies
View Related
Apr 8, 2015
package newdb;
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
[code]....
i want to popup menu add in jlist and select file than open and save through context menu. but popup menu show on frame not in list .
View Replies
View Related
Apr 17, 2014
How would I change items in the main menu (top of screen) that has the app's name on it (e.g. Firefox)? I've used :
System.setProperty("apple.laf.useScreenMenuBar", "true");
And it works, but how would I change things like "About [thisapp]" and make it execute a certain method?
View Replies
View Related
Apr 12, 2015
2 problems with this code:
How do I code this so that after the user has added to the arraylist 'theFruit' if they then press 'V' to view all fruit it includes the default fruit as well as the fruit they've added?
Also in the method 'AddFruit' it only allows me to add 2 fruit before printing. Why is this?
import java.util.ArrayList;
import java.util.Scanner;
public class StkOv {
public static void main(String[] args) {
TheMenu();
[Code] ....
View Replies
View Related
Apr 30, 2015
I cannot use menu selection 4 5 6 7 8 9 10 ... Why NO_EXIT has been declared and used in defining the contents of the map array, rather than just directly using the value 99999 in the map array definition
I don't understand map[][], objectName[] and objectLocation[]
package Assignment;
import java.util.Scanner;
public class GameWorld
{
// the map array holds details on which paths lead to which other rooms. NO_EXIT indicates no valid exit.
// each element holds the details of all paths leading out from a single-room in the order n ,e, s, w, ne, se, sw, nw
private final int NO_EXIT = 99999; // indicates that there is no exit in that direction
private int map[][] ={{NO_EXIT,NO_EXIT,NO_EXIT,1},{2,0,NO_EXIT,NO_EXIT},{NO_EXIT,3,1,NO_EXIT},{NO_EXIT,NO_EXIT,NO_EXIT,2}};
[Code] .....
View Replies
View Related
Dec 5, 2014
I want to create a Jtable when i click on "new" on the menu bar,but if i click on it, i still not see the table.Here is the code:
package mestint
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.*;
[code].....
View Replies
View Related
Apr 23, 2014
//construct and populate the Time menu
Menu mnuTime = new Menu("Time", true);
mnuBar.add(mnuTime);
MenuItem mnuCurrentTime = new MenuItem("CurrentTime");
mnuTime.add(mnuCurrentTime);
[Code] ....
E:Calculator.java:64: error: cannot find symbol
if (arg == "Time")
^
symbol: variable arg
location: class Calculator
1 error
Tool completed with exit code 1
View Replies
View Related
Jun 26, 2014
So i have a problem i want to make a menu that allows you to press 1 and then make lets say a Car,
The code would look like
Car car = new Car();
And then add to my list
cars.add(car);
If in my menu the person presses 1 again, will they add another car or will it override it
Also: how can i make a menu that doesnt allow you to press option 5 (something that requires you something that should be registered in other options ), until you registered them?
View Replies
View Related
Mar 18, 2014
Write a class named FileDisplay with the following methods:
1.) constructor: the class's constructor should take the name of a fil as an arugment.
2.) displayHead: This method should display only the first five lines of the file's contents
Here is the following code I have made so far
import java.io.*;
public class FileDisplay
{
private String filename;
public FileDisplay(String Filename) throws IOException
[Code] ....
First, in my constructor I have taken in an argument and used that argument to open up an output file. Meanwhile, I'm trying to work n the displayhead method to print out information and to read data to. I haven't opened up my input file yet, but I'm not understand how can I read a print data to an output file. in
public void displayHead()
{FileWriter file=new FileWriter(Filename)}
do I make create another instance of the filewriter class to output data?
In simple words, suppose to I want to display some messages on my output file in the displayhead function. Since I already have opened up the file in the constructor, how do I combine that in this method...
View Replies
View Related
Sep 24, 2014
i am beginner in java and i am making an application in which i want to display menu for 3 different types of users. like when we login i want to check which type of user is this and which menu to show them. for ex. if there is a employee the menu bar has a dropdown which shows activities like fill nomination, see details etc. if it privileged user he is shown a diff menu and if its the admin the dropdown shows some different activities. i want to make it through simple jsp and servlet. i have a table in data base which has types of user predefined with an id how to display that menu according to a specific user.
View Replies
View Related
Aug 17, 2014
I am tasked with creating several JPanels each of which has a title centered at the top. As such I have created parent panel that each panel extends. However, I am uncertain as to whether drawing the string on the panel or using a JLabel is the best solution. The panels might allow dynamic resizing...
View Replies
View Related
Jan 22, 2015
Is there a way to connect the popupmenu to the right Object (JFrame).
(Something like SwingUtilities.getWindowAncestor(popupmenu)
I've created 2 JFrames each with the same MouseClass. When you click on the RMB a pop menu is shown with a background item. When clicked on the background item only the last created JFrame changes his background.
Below is my simplified code. I'm probably not thinking like a good OO'er.
static JFrame frame;
static JPopupMenu popupMenu;
public static void main(String[] args) {
popupInit();
frame = new JFrame();
frame.setBounds(0, 0, 230, 230);
[Code] .....
View Replies
View Related
Nov 28, 2014
I am currently tackling homework for a small I/O-program with console input.Right now, only the part when you enter "E" or "e" on the console is implemented and the issue I am trying to tackle is described in the comment starting at line 38:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.Scanner;
[code]....
View Replies
View Related
Dec 28, 2014
I have a question and wasn't able to find what I needed through the search. I am currently using Netbeans 8.0 and working on a desktop app. I have a main GUI file where I am going to add a menu item that can be clicked to open up an "About" Dialog box. The problem is, I don't know how to do this
The file are...
MainGui.java
About.java
How would I go about opening the About.java when clicking on a menu item? I tried using...
new About();
About.setVisible(true);
But this just gave a compilation error.
View Replies
View Related
Aug 20, 2014
I have a frame which I want to load an applet inside it. Here is the code i have in my main method:
MyApplet myApplet = new MyApplet();
myApplet.init();
myApplet.start();
javax.swing.JFrame window = new javax.swing.JFrame("myApplet");
window.setContentPane(myApplet);
window.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
window.pack();
window.setVisible(true);
But I get an exception:
Quote
Exception in thread "main" java.lang.NullPointerException
at java.applet.Applet.getCodeBase(Applet.java:169)
at MyApplet.init(MyApplet.java:78)
at Intro.main(Intro.java:68)
Java Result: 1
View Replies
View Related
Oct 15, 2014
How to go back to main menu and terminate a program?
I just want a Simple code.
View Replies
View Related
May 26, 2008
I need to make a popup menu contains copy and paste in a swing to copy or paste from jlabel or jtextbox , but i dont know how?
View Replies
View Related
Sep 18, 2009
I was wondering if it is possible to make a vertical menu instead of a normal horizontal one. Like this:
Menu 1
Menu 2
Menu 3
And when you then click on one of them you get:
Menu1
Menu2
Menui tem 1
Menui tem 2
Menui tem 3
Menu 3
Is this possible?
View Replies
View Related
Oct 9, 2014
in javafx, how can i implement a composant as shown in the following figure. when i click in the arrow, i must have a menu allows me to do a multiple choice like shown in figure
View Replies
View Related