• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help: "The method is not defined for the type JSplitPane"?  RSS feed

 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my application, I have a method called enableButtons() in a class class called CustomizePanel which extends JSplitPane. From a class called FrameSet, I created a CustomizePanel object called customizePanel.
Whenever I try to call FrameSet.customizePanel.enableButtons(), I get an error stating "the method enableButtons() is not defined for the type JSplitPane". I'm confused because I have done with with JPanel objects and it works fine... Could it have something to do with the JPanels that are part of the JSplitPane? Thanks!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reference to your class must be of type CustomizePanel. Like the error says, FrameSet doesn't have a method called enableButtons().
 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the object "customizePanel" has the method I am trying to use.. I dont understand why it says it is undefined for JSplitPane.(the class CustomizePanel extends JSplitPane).
The CustomizePanel class creates objects for other classes.. could this cause this error? For a Panel, SplitPane, etc.. to be an object, can it not create objects from other classes?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me catch up: So you have a class called FrameSet and it has a member variable called customizePanel. This member variable is declared as type CustomizePanel and is initalized with an instance of CustomizePanel. When you compile FrameSet you get an error that FrameSet.customizePanel does not have the initalizeButtons() method. Looking at your code (which you really should show the relevant parts of), is this the case?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!