Search:

Type: Posts; User: sebbe605

Page 1 of 2 1 2

Search: Search took 0.69 seconds.

  1. Replies
    6
    Views
    27

    Re: Simple coding question, 1 error

    How did you get the block from the beginning?
  2. Replies
    6
    Views
    27

    Re: Simple coding question, 1 error

    Im not sure what your trying to do. please elaborate.

    Also use code block when posting code, see FAQ!
  3. Replies
    6
    Views
    27

    Re: Simple coding question, 1 error

    It's


    System.out.print("-");


    Put some breakpoints out and follow whats happens and im sure youll get a clearer picture of what's happening.

    --- Update ---
  4. Replies
    9
    Views
    147

    Re: ObjectInputStream

    Neither do i. I was looking at another thread there someone had similar problems. They ended up changing the ArrayList to List
    List<Media> mediaList = (List<Media>) inStream.readObject(); but he...
  5. Replies
    9
    Views
    147

    Re: ObjectInputStream

    Couldn't get it to work so i went with another method.



    public void saveOnFile() {
    File file = new File("data.txt");

    try {
    if(!file.createNewFile()) {
    file.createNewFile();
  6. Replies
    9
    Views
    147

    Re: ObjectInputStream

    Okay, i changed some stuff around and i think that this should work, but it doesn't work.



    public void readFromFile() {
    try {
    ObjectInputStream inStream = new...
  7. Replies
    9
    Views
    147

    Re: ObjectInputStream

    This warning: Type safety: Unchecked cast from Object to ArrayList<Media>
  8. Replies
    9
    Views
    147

    Re: ObjectInputStream

    I tried with this earlier:


    public void readFromFile() {
    try {
    ObjectInputStream inStream = new ObjectInputStream(new FileInputStream("object.txt"));
    this.mediaList.addAll(...
  9. Replies
    9
    Views
    147

    ObjectInputStream

    Hello,

    i have saved an arrayList to file using the ObjectOutputStream but now when i try to read the file i get problems.

    saveOnFile:


    public void saveOnFile() {
    try {...
  10. Replies
    2
    Views
    82

    [SOLVED] Re: getComponentAt() return defaultIcon

    Icon returnString = ((JLabel) mediaPanel.getComponentAt(arg0.getX(), arg0.getY())).getIcon();
    System.out.println(returnString);


    I did this and it works.
  11. Replies
    2
    Views
    82

    [SOLVED] getComponentAt() return defaultIcon

    Im trying to get the defaultIcon from getComponentAt()



    mediaPanel.getComponentAt(arg0.getX(), arg0.getY())


    And i get the putput:
  12. Replies
    8
    Views
    230

    [SOLVED] Re: repaint from another class!

    Okay, this is a tricky one. I tried to rebuild the shelf's by simply calling:


    private void addComponents() {
    JPanel shelfs = buildShelfs();
    this.add(shelfs);
    }


    And this as far as i...
  13. Replies
    8
    Views
    230

    [SOLVED] Re: repaint from another class!

    It goes back to the function i call:


    public void repaintWindow() {
    this.getContentPane().validate();
    this.getContentPane().repaint();
    }


    I'm not sure if i can call the repaint. I...
  14. Replies
    8
    Views
    230

    [SOLVED] Re: repaint from another class!

    Errors you say:


    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at project.MediaHandler.addMovie(MediaHandler.java:19)
    at...
  15. Replies
    8
    Views
    230

    [SOLVED] repaint from another class!

    Hi, as the topic follows im trying to repaint a window from another class. the class Window handles an interface that displays pictures of movies. Via a JMenuBar you can add a new movie and its...
  16. [SOLVED] Re: Return statements while building a JPanel!

    It turned out to be an error with the size(); from the ArrayList. Ones i fixed that and changed return null; to return mediaPanel; it worked the way i wanted.
  17. [SOLVED] Return statements while building a JPanel!

    Hello, i'm having this where i'm trying to return a JPanel with tempPictures but only if they aren't already filled with "actual" pictures. However this causes problems because your never shore that...
  18. Replies
    3
    Views
    191

    [SOLVED] Re: JTextField (JDoubleField etc)

    I ended up going with this method:


    double playTime = Double.parseDouble(this.title.getText());


    I think this will work somewhat good tho ill need to cast some error statements in order for...
  19. Replies
    3
    Views
    191

    [SOLVED] JTextField (JDoubleField etc)

    Hello,

    I'm working with a project there ill need to enter some values for an Object and for this i'm using JTextField. However some of the variables are of the types double, int and bool. Is there...
  20. Replies
    3
    Views
    140

    [SOLVED] Re: Using ArrayList!

    This: "It only took 50 hours to solve it"


    MediaHandler myReg = new MediaHandler();


    Is it really a good idea to have a register set as static? I mean i'm going to be adding several medias to...
  21. Replies
    3
    Views
    140

    [SOLVED] Using ArrayList!

    If i declare and ArrayList as follows "public static ArrayList<Media> mediaList = new ArrayList<Media>();" How can i access it in another class (main class)?



    package Projekt;
    import...
  22. Replies
    6
    Views
    130

    [SOLVED] Re: Simple enum question!

    Anyhow i put it in a package now and it works, thanks for the help. Im not used to java or Eclipse and the only experience i have is with c++ so its a learning path for me.
  23. Replies
    6
    Views
    130

    [SOLVED] Re: Simple enum question!

    In the project im working in i dont have any packages included, the classes lay under the (default package). and in the MVCE i did import thiistest.one.number; got included which i tried including in...
  24. Replies
    6
    Views
    130

    [SOLVED] Re: Simple enum question!

    Super:


    package thiistest;

    public abstract class one {

    public enum number{one,two}
    private number myNumber;
    public one(number myNumber) {
  25. Replies
    6
    Views
    130

    [SOLVED] Simple enum question!

    Hi, im having some problems with adding an enum value to an object in an arraylist.

    I've highlighted the part that i can't get to work: rating.five (could not highlight the codesnip)

    ...
Results 1 to 25 of 29
Page 1 of 2 1 2