Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Cannot make a static reference to the non-static method

$
0
0
ok, so I feel like a douche but have been stuck on something that is usually simple.

I have tested these separate and they work fine but when I went to marry them together I had the dreaded Cannot make a static reference to the non-static method

addListenerClass :
if(confirmAdd == JOptionPane.YES_OPTION)
         {
            Course coreTemp = new CoreCourse(
                  ToolBar.getCourseCodeInput().getText(),
                  ToolBar.getCourseTitleInput().getText(), 
                  ToolBar.getCreditPoints());
                  System.out.println(coreTemp.toString());
                  ProgramMap.addCorePanel(coreTemp);
         }


and ProgramMap :

public class ProgramMap extends JPanel {
   
   public ProgramMap(AMSView Frame){
      all the bits
   
   public void addElectivePanel(Course coreTemp){
   all the bits...
}


ProgramMap.addCorePanel(coreTemp); - is the problem...

It is something stupid but I can not remember how to fix it.

Thanks
floppy

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>