Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

variable url might not have been initialized  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4585
6
Java Python 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: 4585
6
Java Python 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: 4585
6
Java Python 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();
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!