Besjamain Greenaway

Ranch Hand
+ Follow
since Dec 21, 2007
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 Besjamain Greenaway

Basically, because I didn't know it existed and what it is used for. I will look into - thanks!
12 years ago
Well, actually I want to use it to align certain characters in the JList. My crude solution so far was finetuning it with the spacebar . Using the tab in the traditional sense would be great if it would be possible.
12 years ago
I think it displays as a zero width, I don't see it making any space. So, I want it not to be zero width, I want it to be x pixels of space that a \t defines.
12 years ago
@Paul Clapham

Yes, I expected the tab character to do something in my JLabel.. Or Jlist.. What I think it should do. Well, use the \t I put in there Seriously, I have no idea why the JLabel or JList shouldn't output the \t or Unicode I put in the String.

@Rob Prime

Okay, for a moment there I thought there was miscommunication I will try this out!
12 years ago
That's great, less adjusting! I'll go and find out what would be more preferrable then, because I don't really see why a JFrame or JDialog or visa versa apart from the modality.
12 years ago
Thanks for your reply, though I forgot to say that this is not a web app, I'm very sorry for that. I have an object in which I'm overriding the toString() method. In the return statement I have something like "blablabla \t blablabla". This object is passed to a JList, but I do not see the tab appearing. Not even when I put in a whole bunch of \t\t\t\t or use the UniCode character.
12 years ago
@k. tsang

I adjusted and compiled the code you posted, and it works. Is it because you left the default layout for JPanel instead of giving it a GridLayout? Maybe I have to fiddle some more with that and see what works and what not...

@Campbell Ritchie

I will look for what you suggested.

Thanks!
12 years ago
Well, I guess I'm back to using JFrame again Thank you for answering my question.
12 years ago
Well, here is part of one it:

Wouldn't you be better off having a JDialog sitting above the main JFrame rather than a second JFrame? Then there is absolutely no danger of closing the app when the dialog closes, you can better control modality type, and you can guarantee that the subwindow always sits above the main one.



I read about it somewhere else as well, but I can't find it that quick, although I have a hunch that I read it on Sun's website somewhere. But I'm guessing that you say that it's okay?
12 years ago
Well, I have a main frame, with a couple of buttons on it. When one of those buttons is clicked, a second window comes up. That second window has a form on it; a couple of labels + textfields, and two buttons "save" and "cancel". I first did it with a JFrame, but was advised to use a JDialog instead. But then this problem arises, and I don't know what to do know.
12 years ago
For now I added a bunch of labels with empty strings to fill the whole thing up. I add a panel to the contentPane, in which I add a panel for the labels, and one for the textfields. Here's my code:
12 years ago
I want it to look the same except that I want the textboxes to be not so high. How is this done?
12 years ago
I'm using this in the toString method of one of my objects which I'm sending to the JList, and the other use is for a JLabel I have. I tried using \t, \U0009, \t\t\t\t\t\t\t, etc., but it just won't work. Does anybody know how to accomplish this?
12 years ago
I took on the advice to use a JFrame for my first screen, and a JDialog for al the other screens. I use a strategy pattern to separate the looks from the behaviour. In the constructor of my behaviour class I instatiate the class for the looks:
Where TafelView is my new screen (JDialog)

Unfortunately, these lines won't run, because it stops on the line that makes the JDialog:

How can I do it so that these lines will run?
12 years ago
Did you manage to download the files? I couldn't upload any JAR's or ZIP's here on the forum...
12 years ago