Mark Vermeersch

Greenhorn
+ Follow
since May 11, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Vermeersch

Hello,

In my application I need to draw some formatted words on a JPanel, and only the upper half should be visible. I solved this by writing RTF text on an AAEditorPane, and drawing a rectangle in the background color over half of that AAEditorPane. All this is done within a running thread.

This works fine. The problem is sometimes the rectangle is drawn before the AAEditorPane, although it is invoked later. The code is something like

Any ideas how I can prevent the AAEditorPane from being drawn on top of the rectangle?

Thanks
19 years ago

Originally posted by Mike Rainville:
Have looked at javax.swing.JTextArea?



Sure, but I want this text behaviour for all the components inside the JPanel: labels, buttons,... everything should behave as a text that performs line wrapping.

But I think I can solve it by overwriting the getPreferredSize() method of the JPanel I'm using.

Mark
19 years ago
Hello,

I've got an empty JPanel to which I want to add an (unknown) number of JLabels. Each JLabel has a text which is just one word. When my program is adding JLabels to the JPanel, I want it to have the same behaviour as a normal text editor: when a line is full, the next line gets filled (line wrapping).

If I just keep adding JLabels to a JPanel of a fixed size with .add(), there's no line wrapping. I tried it by giving the JPanel a fixed size, flowLayout and nesting it within a JScrollPane, but it keeps filling one long line, instead of jumping to the next one.

Any obvious solutions??
Thanks
Mark
[ October 18, 2004: Message edited by: Mark Vermeersch ]
19 years ago
Hello,

I'm making an applet that displays a JEditorPane. The location of the textPane should be changed every 500ms. I did this with a "SlideShow" Thread, as follows:




I used 2 "sleep" commands: the first one is just for waiting for user input. The second one should make the textPane display just for 500mson a certain location. But the problem is the textPane is only shown for about one frame at the desired location, and then jumps to its default location to stay there the rest of the 500ms.
Does anyone know what the problem could be?? I've programmed this as an application and it worked fine. Do applets have difficulties with threads??

Thanks anyway
Mark
19 years ago
Hello,
I need a color chooser like the JavaScript example in this link:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=4220&lngWId=2
Does anyone of you know if the Java code for such a thing is available at some place?

Thanks
Mark
19 years ago
ah, this works. I suspected it would be that easy.
Thanks
Hello,

this is supposed to be easy but I just don't know how to do it. I have a class named XPanel, containing a "Slideshow" thread class. Inside the "run" method of the thread, i would like to use something like "this.getGraphics", with "this" referring to the XParent object. But as I am using a thread class inside another class, this doesn't work and I don't know how to refer to the XPanel object.



Any thoughts on this?
Thanks
Thanks Yuriy, I used this script and it works fine. I must admit it's a pretty creative trick.
Mark
Interesting info. In the meanwhile I dug out the case a little more, and I discovered that the problem is actually caused by a window.open, that clears the referrer info. I've just posted it as a new topic, since it's this is a different problem: https://coderanch.com/t/114767/HTML-JavaScript/nClick-window-open-loses-referrer

Thanks
Hello,

I have a table with cells, and the complete area of each cell should be a clickable link (not only the text in it). Therefore I couldn't use normal hyperlinks, and instead did this as follows, in javascript, for each cell:



After a while I noticed that the newly opened windows don't have any referrer info. I guess that's because of the "window.open" method.

I wanted to know if anyone knows a trick to do this and pass the referrer info to the new window (as is done by a normal link).

Thanks!

(PS: I spelled 0nClick wrong here because otherwise I couldn't post it :-s)
Hi,

that's okay, but I don't want their referrer details, I want them to get mine.

I'm not sure if I explained the problem well.
I just want to redirect to other websites. This works. But when they include the code "document.referrer" this doesn't produce anything. As if there weren't no referrer at all. I think it's because the I use, that removes the referrer or so.

Any hints?
Thanks
Mark
Hello,

I have a page on which I redirect people to other sites, using the following line in JavaScript

This works all fine, but apparently the new site does not know that my site is the referrer. (I've tested that with "document.write(document.referrer);")

Hence my question:
What's the trick to redirect with JavaScript AND pass the same referrer information as does a normal html link?

Thanks!
Mark
This code works nice. I've added some exceptions and stuff.

Thanks!
19 years ago
Hello,

I have a file with on each line a word. I'm looking for a way to these words into a string array.
I suppose it's quite basic... Any clues?

Thanks!
19 years ago