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
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.
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:
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.
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] ....
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();
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}};
//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
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?
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...
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.
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...
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.
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:
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...
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
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