This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

variable url might not have been initialized  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4683
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe im just too loaded tonight but how do i fix this?

the error is at pane.setPage(url);
i just had a thought(epiphany)...i'm gonna try it
 
Randall Twede
Ranch Hand
Posts: 4683
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this compiles

and it works. so there you go folks, that code will open .txt, .rtf, .html. .java, etc
 
David Jordon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I am still fairly new to java, but I would think it is a problem to do with scope...




... I am not quite sure if that makes any sense, but you should try giving this a try






Hope that helps

Cheers
 
Randall Twede
Ranch Hand
Posts: 4683
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David, you missed my second post, i solved it
it did have to do with scope. i put the one try inside the other.
thanks again to Rob for showing me this line
url = file.toURI().toURL();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!