Adding something to a frame under the javax.swing.JFrame Package

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CodeTilYaDrop
    New Member
    • Aug 2007
    • 66

    #1

    Adding something to a frame under the javax.swing.JFrame Package

    Hello,

    I am trying to show a shape in the Javax.swing.JFr ame package. I am using a frame to show it, but I can not get the add method to work. Can someone give me a good example of adding something to a frame with an add method. My code looks like the following:

    frame.add(compo nent);

    I get an error message when trying to add the component to the frame. Any suggestions please....
  • CodeTilYaDrop
    New Member
    • Aug 2007
    • 66

    #2
    Originally posted by CodeTilYaDrop
    Hello,

    I am trying to show a shape in the Javax.swing.JFr ame package. I am using a frame to show it, but I can not get the add method to work. Can someone give me a good example of adding something to a frame with an add method. My code looks like the following:

    frame.add(compo nent);

    I get an error message when trying to add the component to the frame. Any suggestions please....
    I finally figured it out! I needed a subclass of my shape class. This was introduced via using the keyword extend and the JComponents package. This helped to pick up the component in the program.

    Problem Solved....

    Comment

    Working...