• Post Reply Bookmark Topic Watch Topic
  • New Topic

netbeans TextWindow  RSS feed

 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys.
I use netbeans IDE and I have following problem:
here is my code:




simple, but I get following errors:

can not find symbol
symbol: class TextWindow
location: class textwindows.Main

I use NetBeans IDE 6.8, JDK 1.6

I searched in google and I found that I must include "java.awt.Frame" in my project.
But when I right click on "library" folder and choose "add library" I see no "java.awt.Frame".

Please help me, if I can not include library I can not learn java, its really different with other programming languages and I don't know what to do.

any help is appreciated
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> I use netbeans IDE and I have following problem:

well, we have the problem when you post in multiple forums:

http://www.javaprogrammingforums.com/java-ides/16665-netbeans-textwindow.html

i.e it potentially wastes our time, so, I think I have the solution,
but won't waste any more of my time posting it. good luck.
 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, we have the problem when you post in multiple forums:

http://www.javaprogrammingforums.com/java-ides/16665-netbeans-textwindow.html

i.e it potentially wastes our time, so, I think I have the solution,
but won't waste any more of my time posting it. good luck.


I do not post in multiple forums.
Last night I searched "java forum" in google.
It found http://www.javaprogrammingforums.com at top, I thought it should be better than other forums, I registered there but since no one replied me within 17 hours I decided to leave there and join somewhere else. And I found here.

Thanks I dont need help anymore.
I choose to use "Windows Command Prompt" rather than NetBeans IDE, at least it works.
 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lol. Same error in "Windows Command Line"... .

okay. I promise you right now I only use http://www.coderanch.com forums. So please help me.
I attach some screenshots hope it help to solve problem.

Thank you guys for help.
java.jpg
[Thumbnail for java.jpg]
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
masoud keshavarz wrote:I promise you right now I only use http://www.coderanch.com forums.

There is no problem with you using whatever forums you want. It's just polite to put a link in each of those forums (not just this one) to your posts in the other forums, then people will be able to see what answers you have already received and not repeat them.

So all you needed to do was put in your first post something like

I have already posted this question in this forum but didn't receive any answers.

and then just remeber to update it if you do receive a useful answer.
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no class called TextWindow in the standard API. Assuming you are using a 3rd party library of some sort, you will need to include an import statement for the TextWindow class and also make sure the library is in your classpath.
 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stuart, thank you for reply, your so adorable.
And thank you for remind me how to be nice in forum, I'm really thank you.

There is no class called TextWindow in the standard API. Assuming you are using a 3rd party library of some sort, you will need to include an import statement for the TextWindow class and also make sure the library is in your classpath.


This is my first program in java, therefore I don't know HOW to import class in my project.
I read this article and I changed my code to this:



But still I get same error.
All I want is to create a "text panel" and display some messages into it as a first program in java.

Thank you for help
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't understand about packages and import statements, then this tutorial should explain it all.

Once you've read that, you will need to import the package that your TextWindow class is in. I googled TextWindow but there appear to be a number of classes with that name, so you will need to find out the full name of the class. The documentation for the library should tell you that.
Youi will need something like

but obviously you will need to change the speckles.gui bit to whatever the package name of your class is.

You will also probably need to add your library jar file to your classpath. See HowToSetTheClasspath for help with this.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
masoud keshavarz wrote:This is my first program in java, therefore I don't know HOW to import class in my project.

Then you need to find out, because you won't get very far without it.

I read this article and I changed my code to this:

Well first, their class is not standard. Second, Java is case-sensitive, so 'textwindow' is NOT the same thing as 'TextWindow'.

Winston

[Edit] Too slow.
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just noticed the link to the article in your post. Try changing the code to


Your class doesn't need to extend JFrame. It's the TextWindow class that does that.

You will still need to add the library jar file to your classpath before it will compile.
 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Stuart and Winston, thank you for help.
I investigated to what you told me. And I added following line to my code:


As you said in compile time it throw following error:
package ij.text does not exist

I couldetn find "ij.jar" file anywhere in my computer to set classpath on it.
Therefore I downloaded this and installed it.

I modified my CLASSPATH to this :
.;C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip;D:\Program Files\ImageJ\ij.jar;

But still same error in compile time: package ij.text does not exist
If you help Im really thankful
 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well first, their class is not standard.


Winston, If this is not a standard class, may you tell me a standard class to display a text panel?
I tried many classes but all of them have different missing packages.
 
Campbell Ritchie
Marshal
Posts: 56540
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain. What do you mean by missing packages? Which classes did you try?
 
masoud keshavarz
Greenhorn
Posts: 21
Firefox Browser MySQL Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you everyone.
I used this step by step tutorial.
I executed my first java program successfully
 
Campbell Ritchie
Marshal
Posts: 56540
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It’s a text area? That is really easy to use.
Try writing much more text in that text area, several lines long. Then swap it for a text field and see what the difference is.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!