Search:

Type: Posts; User: joachim89

Search: Search took 0.16 seconds.

  1. Replies
    1
    Views
    963

    Showing a picture in a GUI

    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...
  2. Replies
    9
    Views
    1,342

    Re: A program with a GUI

    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:


    ...
  3. Replies
    9
    Views
    1,342

    Re: A program with a GUI

    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...
  4. Replies
    9
    Views
    1,342

    Re: A program with a GUI

    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...
  5. Replies
    9
    Views
    1,342

    Re: A program with a GUI

    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...
  6. Replies
    9
    Views
    1,342

    A program with a GUI

    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...
  7. Replies
    1
    Views
    757

    A question about inherited methods

    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...
  8. Re: "java.lang.NoSuchMethodError: main" and "fatal exception occured."

    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...
  9. "java.lang.NoSuchMethodError: main" and "fatal exception occured."

    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;...
  10. Re: Creating a class for points in three dimensions.

    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...
  11. Creating a class for points in three dimensions.

    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){...
  12. Re: Beginner needs help with simple java assignment.

    Ok, I've made som necessary changes to the program.

    Code:



    import java.util.Scanner;
    public class BinaryConverter {

    public static void main(String[] args) {
  13. Beginner needs help with simple java assignment.

    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...
Results 1 to 13 of 13