Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new window within a program...

 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgive me, I'm new at this gui stuff with java.
What I'm trying to do with this code is to create a new window (that is what the FileButtonHandler class is for) when the file button is clicked with a couple of entry fields and some buttons. The problem is that, when I compile, I get this error message for each of the objects I've created withing the FileButtonHandler class:
C:\brandijava\IncomeAnalysis.java:88: illegal start of expression
private JLabel annualIncomeLabel
Anyone have any idea how I might fix this so that the program will compile and I can get the window to pop up?


[ November 21, 2003: Message edited by: Brandi Love ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"private" can only be applied to member variables, not local variables declared inside a method.
 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should they be declared as public? I tried that and it didn't work.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Local variables cannot have access specifiers. They are not going to be accessed from outside the method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic