Search:

Type: Posts; User: Lora_91

Page 1 of 2 1 2

Search: Search took 0.07 seconds.

  1. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    I've progressed quite a bit with the program and it should be getting close to finished, thanks to all of the help you've given me! :)

    Right now I'm trying to add a way to print out all of the...
  2. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Thanks, got it to work! =)

    I've also gotten logging to work to some degree (storage of log in/out data), as well as all the data saved and loaded in .text files whenever the program is...
  3. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Hm, not quite sure of what you mean with passing the value in a constructor, which members are you referring to?
  4. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Alright, thanks, that works great! =)

    Sorry for the slow response, I've been a little busy with other projects so I didn't have much time to look over the coding the past few days....
  5. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Ok so I've come to the conclusion that I need to change it to work the way you suggested, because the current referencing refuses to cooperate the way I would like it to. =/

    MemberFrame.java...
  6. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    After fooling around with the code for a bit I found what was causing the issue, and it is now resolved. =)

    It became a lot easier to understand when I streamlined the creation of the users into...
  7. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Ok, so I've run into a couple of more problems. =/

    Since I need to be able to save all the information when the program closes, and load all of the information when the program starts up, I...
  8. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    No, but I found a similar solution!


    StringMembers[index] = new JLabel(firstName + " " + lastName);
    StringMembers[index].setLocation(70, index * 30 + 30);
    ...
  9. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Odd, I tried both adding StringMembers[index].revalidate(); and changing it from a JLabel into a JTextfield, neither worked. =/ It's especially weird since it worked earlier, and the buttons are...
  10. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Ah, how silly of me, thanks! =)

    The only odd thing now is that another part of the code stopped working whilst we fixed the rest, it's not giving any errors or anything, the names of the users...
  11. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Ah thanks! I removed the memberFrame MF = new memberFrame();, as well as set the variables to null, and that seems to have solved the issue, the frame is being closed without any errors. =)

    I...
  12. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    When you press the AddMemberButton:

    if(e.getSource() == AddMemberButton)
    {
    while(cancel == false)
    {
    MA++;
    int index =...
  13. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Isn't createGUI() called from MainFrame.java? That's how the whole frame is created?


    muffin = MemberFrame.createGUI();

    Or do I need to do something more than that?
  14. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    The lines "Check is 0, disposing of dialog" and "Disposal finished" is printed, but nothing else, and the JDialog/frame is still up. =/
  15. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    It does not, and I get a notification message on the line where we create the dialog2:


    dialog2 = new JDialog(dialog1, "", Dialog.ModalityType.APPLICATION_MODAL) //The serializable class...
  16. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Removed the while loop but it didn't make any difference, since the code never returns back to that part until the JDialog/frame is closed down, and it refuses to be shut down with the dispose call....
  17. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Currently, nothing happens when I press the complete button, I added a JOptionPane.showMessageDialog(null,"Complete"); just to check and it is being run as it should, but the frame isn't closed down...
  18. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Seems to work, this is the entire memberFrame.java class:


    package LoginSystem;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.lang.reflect.*;
    import...
  19. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    I did say that at post 38 yes, but it was resolved in post 40, I apologize if I was unclear. =/

    I added a JOptionPane.showMessageDialog(null,"Dispose");

    And it's being called as it should, but...
  20. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    You misunderstand I didn't receive any null pointer exception with this, but I can't seem to close the frame either.

    dialog2.dispose();
    frame.dispose();
    One of those...
  21. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Static is indeed confusing, which is one of the reasons I try to avoid it the best I can. =/

    I thought I was initializing them with:

    frame = new JFrame(WindowName);

    ...
  22. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Ah thanks that worked! =)

    Only issue that seems to be appearing now is that the memberFrame.java class is having issues closing down the second created frame, which is odd considering it worked...
  23. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    I was confused with what to initialize it with and got an error that asked me to change it into that. =/


    public class MainFrame implements ActionListener
    {

    memberFrame MemberFrame =...
  24. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    I added it at the top together with all of the other variables:


    public class MainFrame implements ActionListener
    {

    public memberFrame memberFrame;
    memberFrame MemberFrame =...
  25. Replies
    79
    Views
    4,736

    Re: Multiple instances of a class

    Hm, I had missed doing that, and it would appear I'm not entirely sure of how to do it. I added:


    private memberFrame memberFrame;
    memberFrame MemberFrame = memberFrame;
    Into the variables...
Results 1 to 25 of 41
Page 1 of 2 1 2