Search:

Type: Posts; User: Norm

Search: Search took 0.16 seconds.

  1. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    I don't normally do weird GUI. Removing components and resetting layout in a container is not something that makes sense to me.
    I really have no recommendations for you if want to do this kind of...
  2. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    Now you have gotten into a conflict with the layout manager. You have already added some components to the frame and shown it. Where should the layout manager put the new ones you want to add?

    The...
  3. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    You don't have to move the code.
    You do need to pass a reference to JFramePlayArea to the CreatePlayField class and save it in the jFrameMain variable.
  4. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    Then change your code so there is only one frame created and add your components to that frame.
  5. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    One difference between the two frames you create. You do this for the first frame:
    new jFramePlayArea().setVisible(true); // Create first frame and set visible

    You create a second frame here...
  6. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    Your starting frame shows with one button on it.
    Look at that code and see what it does and what you have not done in the code that is not working.
    Obviously you have all the right code for the...
  7. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    Can you explain why you are having problems creating labels? You can create a label like this:
    JLabel aLabel = new JLabel("Some text");



    Where is the JPanel defined? What is its variable...
  8. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    What do you want or expect to happen?
    Try debugging your code by adding printlns to the places where you think something should happen.
    The output will show you if the code there was executed.
  9. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    When I execute it I get one button in the lower left corner labeled: jbutton1
  10. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    horizontalLine[X] is a reference to a JLabel. You can add it anywhere you can add a JLabel.
    aFrame.add(horizontalLine[X]); // add a JLabel to a JFrame
  11. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    The get method returns an Object. The Object class does NOT have a setBackground() method.

    Why are you using arrays of Objects vs JLabels?
    JLabel[] horizontalLines;
    ...
    horizontalLines[...
  12. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    When you get an error, please copy and paste here the full text of the error message.
    Without the error message we can only guess at what your problem is.
    To copy the contents of the command prompt...
  13. [SOLVED] Re: Accessing && Editing properties of objects in an array. Plus a few more questions

    When you get an error, please copy and paste here the full text of the error message.
    Without the error message we can only guess at what your problem is.
Results 1 to 13 of 13