axel axek

Greenhorn
+ Follow
since May 28, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by axel axek

Nice

I haven't thought of it this way...

Thank you!


....
A life to learn everything about Java is not enough...
13 years ago
ok...i know that there is such a feature.....but....the question is....what would trigger the clearSelection() on the button group?

Supposing that a GUI only has 3 check Boxes belonging to the same button Group, clicking on one of them will select the desire check Box, but when clicking again on the same check box in order to deselect it, it won't...
...how can the clearSelection() method be used in this case? (you can't trigger it by a check box in this case.....)
13 years ago
and how would that button be selected if it is invisible?

...i mean...what dependencies could be set in order to clear the ButtonGroup when clicking on a selected checkbox?
13 years ago
Hi

Is there any way to deselect all CheckBoxes belonging to the same ButtonGroup?

Quote from javax.swing.ButtonGroup
"Initially, all buttons in the group are unselected. Once any button is selected, one button is always selected in the group. There is no way to turn a button programmatically to "off", in order to clear the button group. To give the appearance of "none selected", add an invisible radio button to the group and then programmatically select that button to turn off all the displayed radio buttons. For example, a normal button with the label "none" could be wired to select the invisible radio button."



...so....it may be possible by using an "invisible" check box?.... I just do not see how....

Any ideas?

Best Regards,
Alex
13 years ago
the complete error is this

Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:687)
at Sesiune.init(Sesiune.java:595)
at Sesiune.itemStateChanged(Sesiune.java:294)
at java.awt.Choice.processItemEvent(Choice.java:604)
at java.awt.Choice.processEvent(Choice.java:571)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

15 years ago
this is the code that reads form txt:
where "model" is Jlist model

and i have tried to read from list:
the line i'm tryng to read is something like: "S LLLL 0.2"
15 years ago
I am having problems reading from a JList, my application consists in adding text line by line from a text file to a JList, ..and the problem that i am facing is...how can i read elements from Jlist, character by character .... help please....
15 years ago
this is the code that reads form txt:
where "model" is Jlist model


and i have tried to read from list:
the line i'm tryng to read is something like: "S LLLL 0.2"

does anybody know any alternatives to read from a JList.....or a solution here....please help
and oh yes ..i've forgot to mention that this works just fine when using java.awt.List, but when i use JList...."bang" errors
15 years ago
I am having problems reading from a JList, my application consists in adding text line by line from a text file to a JList, ..and the problem that i am facing is...how can i read elements from Jlist, character by character .... help please....
15 years ago

Problem solved in cross-post, thanks to Maxideon and without need for actionlisteners at all. Quite elegantly too, I may add (I wish the solution were mine).



yes ....it seems that Maxideon found it http://forums.sun.com/thread.jspa?messageID=10724204 ...I never thought about it in this way....
I want to thank those who were involved in discussing and investigateing my problem..specialy to "Fred Hamilton" and "pete stein" "keep up the good work!!!"
15 years ago
have you tried....panelImg.setLocation(0,0) for the panel with the image?..or panelImg.setBounds(0,0,panelImg.getWidth(),panelImg.getHeight())???
seeing your code I realized that you have created a new class for your panel (titlePanel), so you could also try :
15 years ago

One other posisibility. If basicPanel is the only thing you are adding to the contentPane, then instead of adding it as BorderLayout.CENTER this way: getContentPane().add(basicPanel, BorderLayout.CENTER);

consider instead setContentPane( basicPanel );

You wouldn't think that makes a difference, but I have seen a strange problem solved this way.



There is no difference in using "getContentPane().add(basicPanel, BorderLayout.CENTER);" or "setContentPane( basicPanel );", i've tried them both and the same thing happends. Anyway... the link

https://coderanch.com/t/446219/Swing-AWT-SWT-JF.../java/Sizing-application-image

the guy seems to have truble with resizing the frame, to match his img...and i don't think that borderLayout have someting to do with it...Anyway we're deviating from my problem....
15 years ago

Agree. See this link in the other posting. Notification like that should apply to both fora.


yes..sorry for that...Sorry if I upseted somebody I just wanted to get a answer right away....the problem that i'm having is realy annoying, and the code is an example part of a project with GUI, and time is pressing me down to solve it realy quick....so...i tried to get help from here also....and still nobody knows solving it....
15 years ago

OK I see what you mean. Still, I don't imagine you are too happy about all those action listeners just to trigger a repaint. If I was looking for an easier way I'd try without all that. But I guess you thought of that.



in spite of my search I haven't managed to find details about this kind of problem, and nobody seems to know the cause of the problem...i find it really strange
15 years ago
isSelected() returs false....so....that is not the case here...the problem is in updating the panel because of panel overlap components are not redrawing correct, so they leve a mark on the panel after a change has ocurred (select, dragging...etc)
15 years ago