Lars Tode

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

Recent posts by Lars Tode

Hi,
I've build an application that connect to a server. The connection works fine and there are no much problems with it.
When I'm start the application again, when the first instance is still running, I get the problem that the program connect again to the server and the server registered the program as a new connection.
All data which is send from the server to this application arrived at the first instance. Is there a possibility to check if there is still an application (my programm in the first instance) is running on the client-site, so that I can stop the client starting before it can connect the server?
Regards
Lars
Hi,
I also use the GridBagLayout but I still have problems with it.
For example when I use a JEditorPane in a JScrollPane and I don't specify the size of the JScrollPane (with setPreferredSize, setMaximumSize, setMinimumSize) it collapses.
Do you know a possibility?
Regards
Lars
22 years ago
Hi,
i have a window (jframe) with some components. Theres a JTextArea in a JScrollPane, some JButtons, a JMenuBar and some JLabels.
My problem is that when i show the window on other os than mine, the proportion of each component changed. Because i've worked width fixed
sizes for each component, i get the problem with the proportion of the components.
Now i want to create component which have relative sizes to the window, example jscrollpane.setPreferredSite(new Dimension(windowWidth - 10, windowHeight - 50)).
But i'm not sure that it is the right way. I found in the API the method getInsets() for JFrame
but whenn i used it, i get for ((Insets)myWindow.getInsets()).left 0.
Is there a possibility to get the Dimensions of the JFrame including the border, title an menu?
Greetx
Lars
22 years ago
Hi,
I fill the JEditorPane with a html-side
JEditorPane myPane = new JEditorPane("");
myPane.setPage("file:"+fileDirectory+"foo.html");
I add a hyperlink listener to the JEditorPane. Everytime when a link was hit and the site doesn't exist I show my own error-message :

When I am now hit the link Index the hyperlinkevent is fired nothing happends.
I looked a long time why nothing happends. I guess the reason is the method setText in the catch-block.
For debugging I changed the setPage()-method to setText("to the <a href=\"myIndex.html\">page</a> to the <a href=\"nofile.html\">Exception</a>"); in the try-Block. When I'm now click the Exception-Link, the IOException will execute.
When I'm now hit the other link after that, the text in the try-block is showing.
Ok so what I've found out is :
Exception => setText("asdsadsadsa"); -> hit link -> setPage() doesn't work
Exception => setText("asdsadsadsa"); -> hit link -> setText() work's
Exception => setPage("foo.html"); -> hit link -> setPage("foo.html") work's
What I'm doing wrong?
regards
Lars
22 years ago
Hi Manfred,
thanks for your help, it works! The table is now showing images and buttons
But i've another last question, sometimes the table shows the text, not the buttons. What can be the reason??
Regards
Lars
22 years ago
Hi,
is it possible to combinate two differen CellRenderers? For example a ButtonRenderer and an ImageRenderer???
Regards
Lars
22 years ago
Hi,
first thanks for the link.
I take the example an tried to rebuild it, but I've now another problem. I tried to put Images and JButtons together in the JTable.
Either I can the image or I can see thew Button, but not together.
What I'm doing wrong.
Here the code of my AbstractTableModel :

Greetx
Lars
22 years ago
Hi,
now I tried a long time to implement an JButton in a JTable-Cell.
I know that I've to write a CellEditor and a CellRenderer, and may be a TableModel.
I read the Swing-Tutoriel from Sun, but I really have problems with it. I looked in the examples but I doesn't understand it.
How is a CellEditor, a CellRenderer and TableModel built up?
What I've to do, to realize what I want?
How I implement what I've created?
Based on some examples I tried to rebuild the editor on my own :

Do anyone knows some other good sites or tutoriels about this?
Greetx
Lars
22 years ago
Hi,
I had the problem that my programs stopped sometimes during an exception is appeared (until Ctrl + C is used and it goes on).
First I thougt that I don't catch all exceptions, but it seems that's not the reason.
I also thought about a conflict in the memory, but I'm not really shure about that.
Does anyone knows that problem?
greetx
Lars
23 years ago
Hi,
i don't want "Always on top", i only try if somthing change in my window to move it to front.
Sometimes it does what i want, sometimes i stay behind the other windows.
Is there a method where i can finde out if there are some other windows in front of mine?
greetx
Lars
23 years ago
i use a windows-system
greetx
Lars
23 years ago
Hi,
I tried a long time to move a window automatic in front. I used for this the methods
myWindow.toFront(); and
myWindow.show();
My problem is, that this 2 methods sometimes doesn't work.
Are the some other methods that I can use for this?
greetx
Lars
23 years ago
Hi,
i've there a gui, where the user can change the LookAndFeel.
I don't want that the user can change the window size for example. my problem now is, that when the user change the LookAndFeel, the size off components changed (a JTextArea f.i.).
Because i don't want to implement for each LookAndFeel own dimension, i search for an other posibility.
So, is there a way to find out the dimension of the LookAndFeel that is used for each component?
regards
Lars
23 years ago
Hi Premila,
I got a solution few days before
thanks 4 ur help

greetx
Lars
23 years ago
Hi,
thanks for ur help
I dint really make an instance of the class JMenu. I've written a method that returns a JMenu. So i'd to work with no variables. Is there a way to do it without mb.add(edit); ??
greetx
Lars
23 years ago