I'm doing a lending register inwhich different types of objects (books, cd's and films) are represented. I have a GUI consisting of a AbstractTableModel with an ArrayList in it. The different classes...
Type: Posts; User: joachim89
I'm doing a lending register inwhich different types of objects (books, cd's and films) are represented. I have a GUI consisting of a AbstractTableModel with an ArrayList in it. The different classes...
I made a method called addToList that takes an ArrayList and an object as parameters. Evidently it it supposed to add the object to the list. My class for the dialog box looks like this now:
...
I decided to create a JFrame with data fields.
Here's an EventHandler class that reads input from the JFrame dialog box.
(createNew is a JButton)
public class EventHandler implements...
Ok, I decided to make my own JFrame instead.
But still I can't get it to run just for a quick test.
This code gives me the error message that the method setVisible is undefined for the type...
Is it possible for me to create my own JOptionPane? I need more than one string to pass on to the constructor.(The constructor takes like 6 parameters of 3 different types). Of course I could have...
I have an (a subclass to) AbstractTableModel which contains an ArrayList of type Item (a home-made class) and some basic methods such as add, remove,getColumnCount, getRowCount and getValueAt. This...
Disclaimer: This is not an intricate problem. Don't mind the wall of text if you dont want to/have the time to read everything.
I perfectly understand the principle of inheritance, I am just not...
I've put the static modifier in front of the main method now, and I think it's outside the inner class..
Still I get: "Exception in thread "main" java.lang.NullPointerException
at...
This code gives me those error messages when I run it.
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;...
Ok, but how do I make it store the six variables and make them accesible in distance() ?
Copeg: Yes, I meant Overloading, not overriding. But is my code overloading the distance method at this...
I have written a class for, as the title says, points in the three-dimensional space.
import java.awt.Point;
public class Point3d extends Point{
public Point3d(int x, int y, int z){...
Ok, I've made som necessary changes to the program.
Code:
import java.util.Scanner;
public class BinaryConverter {
public static void main(String[] args) {
I'm trying to implement a program that reads binary numbers from the user and returns the equivalent in the normal (decimal) numeral system.
This is what I've come up with so far:
import...