I have a word wrapping issue when using JTextPane. I think it's my IDE (JCreator) but when i use the source everyone else is using I get several errors. Sorry for the line breaks... Could it be my IDE or can someone please let me know the right way of doing this. TIA -Roland
The source I am using can be found at http://java-sl.com/tip_html_letter_wrap.html
lol.. I forgot the space! Thanks all. It is going to proceed. I have been programming all night and am a little groggy. Best of luck -Roland
> --------------------Configuration: inigui - JDK version <Default> - <Default>--------------------
> C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:283: error: ')' expected
> gentextp.setEditorKit( newHTMLEditorKit(){
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:285: error: ';' expected
> public ViewFactory getViewFactory(){
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:330: error: illegal
> start of type
> });
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: <identifier> expected
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: illegal
> start of type
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: ')' expected
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: ';' expected
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: illegal
> start of type
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: <identifier>
> expected
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: ';' expected
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: illegal
> start of type
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:337: error: <identifier>
> expected
> panel.setLayout(new GridLayout(1, 1));
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:339: error: illegal
> start of type
> return panel;
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:339: error: ';' expected
> return panel;
> ^ C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:341: error: class, interface, or enum expected } ^ 15 errors
You are missing a white space after the
new
keyword:should be
See how syntax coloring changes between the two?
The linked code needs space chars in 3 places to compile.
E.G.
should be:
Look at the line numbers identified by the compiler for the others.
I tried the linked source myself and it work fine (Eclipse)
However, based on the error message you pasted here, you are clearly not using (exactly) using this code.
Apparently, your compiler has issues on the following lines:
C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:283 C:\ucdhb2\gaia\inigui\inigui2\src\inigui.java:285 ...
I recommend to revise the correct usage of the brackets, semicolons, etc.
If you still have issues, please post YOUR code.