Richard West

Ranch Hand
+ Follow
since Jan 07, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Richard West

Hi everyone,

Anyone at all, any idea why this is happening?

Richard West
18 years ago
FTP
Hi everyone,

Currently i am trying to connect to a site using ftp using the below method to upload a file



Now my question is how from java can i create or delete a directory as well as create or delete a file using ftp?

Is there also a way i can just connect to a ftp site say ftp.foo.com without specifying the file name so that i can connect to the ftp site first, create a file first then go to that file?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

I am currently trying to use the HTML preformat tags in a JTextPane using the the HTMLDocument class.

This is the function where i apply the preformating



Now i am able to save the preformated text as HTML but the the problem starts when i read it back, there seems to be additional 2 carriage returns where there should only be one.
This occurs only when i read the HTML document using the html kit class but when i use a browser to read the html file there are no extra carriage returns.

The reading of the document is correct as this problem only occurs when the preformat tags are involved, else the problem does not exist at all.

This is how the reading of the document is done



As you can see its unlikely anything is wrong with it but do correct me if i am wrong.

My question is why do these extra carriage returns occur?

Am i applying the preformat tags wrongly somehow?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
[ November 25, 2006: Message edited by: Richard West ]
18 years ago
Hi everyone,

Originally posted by Peter Taucher:
Head over to:
http://wordhoard.northwestern.edu/userman/javadoc/edu/northwestern/at/utils/swing/XTextPaneTableCellRenderer.html

It's under GNU General Public License and seems to run very well.



The link you showed me leads to a javadoc and does not seem to lead to any examples or code.

Do have the link to where this TextPane renderer code or example resides at?

Richard West
18 years ago
Hi everyone,

I decided to revamp the entire cell editor and the new editor looks like the below



There now still seems to be a little problem.

You see now font can be applied to the cell in a particular sentence when the cell is selected but when the cell is deselected the font all dissapears

Also once i have have applied font to the selected text in the and deselected the cell the font all dissapears as mentioned earlier but also when i edit the same cell again the font is also all dissapears.

Why is it reacting in this way?
Am i missing something?

Will it make a difference if a renderer that is appropriate for this use is written?

If yes how does one go about writing this renderer?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

Anyone at all?

Richard West
18 years ago
Hi everyone,

Originally posted by Sam Codean:
Where are you setting the editor component ?? I see that you are only setting a JTextPane as the Cell Renderer and not the Cell Editor. Both are different.



I tried writing and using the below code by extending the DefaultCellEditor class and uisng it but it only got worse as now if i apply the font to the selected text in the cell all the text dissapears

Here is the code of the class theat extends the default cell editor class



Here is the entire code using the above class which compiles



Why the JTable is reacting in this way i am not sure and hope someone can
point out to me why this is happening.

Thank You

Yours Sincerely

Richard West
[ November 21, 2006: Message edited by: Richard West ]
18 years ago
Hi everyone,

I am currently trying to use a JTextPane as a cell renderers for a JTable but it does not seem to work although the program compiles. I alsways get an error stating class cast exception saying that i must cast the editor component to JTextField instead of a JTextPane although i am using a JTextPane as a cell renderer.

This exeption gets thrown when i try to apply some font to the selected text in the JTextPane.

Below is a small compilable that i have done which compiles and throws the exception that i have mentioned about

Here is the compilable example



Why this exception is occurring i am not very sure and really hope someone can help me with this problem.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

Originally posted by Alan Moore:
The real question is, will the other system be using a font that can display that character?



Since its unicode would the font be more less the same across all systems?
Correct me if i am wrong.

Richard West
18 years ago
Hi everyone,

I am trying to insert some unicode into a JTextPane document but i have a concern as to whether the unicode will be recognized on other platform besides windows.

This is what i did



Will my above code be recognised on other platforms besides windows because of the unicode that i am inserting?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

I currently have a JTextPane using a html document and i am trying to serialize the html document contained in the JTextPane to the disk but i have run into some problems.

One problem lets say for example if i were to press the space bar five times and then type some text into the JTextPane and serialize it, everything seems alright except that when i read back the html document the space where i had pressed for five times has dissappeared and the text that i typed in is just left justified.

Another problem i have lets say for example if i were to press the carriage return five times and then type some text into the JTextPane and serialize it, everything seems alright except that when i read back the html document the carriage returns where i had pressed for five times has dissappeared and the text that i typed in is just placed at the top of the document in the JTextPane.

Why this is happening i am not sure but i am providing a compilable example for you guys to see what actually the problems that i am currently facing.

Here is the compilable example.



My only idea i guess is that i must be serializing the document wrongly, but i tried to yahoo but came up with nothing.

I hope someone knows why this is happening as already i am out of ideas.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

I would like to ask you guys a very general question.

Is there a maximum limit on how big a .java file(in kilobytes) can be, or is there no restriction on this?

Any help is graetly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

Please bear with me for a while as i need to ask a rather silly question.

Does anyone know how to decalre an object of arrays with arguments.

See the below code



The above program obviously does not compile because of the below line



My question is basically how to i declare it as an array of 5.

Sorry again for the silly question.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
18 years ago
Hi everyone,

Originally posted by Paul Clapham:
Just use FileInputStream and transfer all files as binary.



You mean FileOutputStream right?
I am talking about uploading to a server.

Please correct me if i am wrong.

Hoping to hear from you

Yours Sincerely

Richard West
18 years ago
Hi everyone,

Originally posted by Ben Souther:
Re-opened at the original poster's request.

[ August 01, 2006: Message edited by: Ben Souther ]



Thanks Ben

Richard West
18 years ago