Win a copy of Spring Boot in Practice this week in the Spring forum!

PierreArnaud Galiana

Greenhorn
+ Follow
since Jun 13, 2001
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 PierreArnaud Galiana

Here the reason for your problem: 0.1 cannot be represented as double... (!).
Ok this post is old, but I recently found this stuff while reading the BigDecimal javadoc:
BigDecimal(double).
The recommended way is to use the BigDecimal(String) constructor.
21 years ago
This could help: SkinLF SkinRegion.
(and please perform a search on the forum before you post, this will prevent the same topics to be answered every week)

[This message has been edited by PierreArnaud Galiana (edited July 05, 2001).]
21 years ago
I'd suggest to use the Document, as described in the Tutorial.
Take advantage of the MVC architecture of Swing: the model (Document) contains the text, the view/controler (JTextField) displays/controls it.
21 years ago

Originally posted by karl koch:
it occured to me that i could develop, compile and run an application on my computer and when i gave it to the customer he could not since some classes were not present in jre that were in jdk


I'd be happy to know which classes were missing, on which version...
Have a look at the J2SE. The diagram at the end says it should not be so...
21 years ago
it may work better with javac ;)
jre = java runtime environment
jdk = java development kit (includes the jre)
you need to install the jre to RUN java applications (if you don't have a jdk)
you need to install the jdk to DEVELOP and RUN java applications
the jre is installed in your jdk directory, under... 'jre' ;)
it contains the jars, some jvms and a few exe (java...)
it's basically a subset of the jdk targeted to java app user
[This message has been edited by PierreArnaud Galiana (edited June 26, 2001).]
[This message has been edited by PierreArnaud Galiana (edited June 26, 2001).]
21 years ago
Dear Remi, please have a look here:
How to Use Menus (go under the "Bringing up a popup menu" paragraph).
You'll see you have to use the isPopupTrigger() method of the MouseEvent to decide whether to call show() or not.
If you do not, then it happens on each mouse event...
'gld 2 hlp'...
[This message has been edited by PierreArnaud Galiana (edited June 25, 2001).]
21 years ago
mmh, looks like you need to implement the singleton pattern... (and this has nothing to do with Swing/JFC/AWT)
have a look here:
GoF singleton pattern
Singleton in Java
your ChildWin will implement the singleton pattern, and when ParentWin wants to get a ChildWin, it will call the instance() method
[This message has been edited by PierreArnaud Galiana (edited June 23, 2001).]
21 years ago
Well, it depends how new you are to Java... (anyway welcome)
And being french is not a problem either ;)
If your problem is to use a JTable, then have a look at the tutorial: How to Use Tables.
For the circles, try this: Shapes.
21 years ago
maybe you should check the 'fill' and 'weight' attributes of your GridBagConstraints...
21 years ago
More generally, elements in a JComboBox are Objects. The toString() method is then applied to the objects in order to display them in the list or on the button.
So you could use any Object with an appropriate toString method for display, whereas the getSelectedItem() methods returns you the Object, not the String (much more comfortable than the awt Choice, isn't it ?).
In your case, you could use a java.lang.Integer.
Now more details on rendering: the JComboBox uses a ListCellRenderer to... render the objects in a JList. The default implementation of the ListCellRenderer, DefaultListCellRenderer simply extends JLabel, and call toString on the Object to render.

[This message has been edited by PierreArnaud Galiana (edited June 22, 2001).]
21 years ago
would be a nice day to switch to swing !
if your really want to keep your java.awt.TextField, then I assume you'll have to play with listeners...
21 years ago
Try this: subclass a JTable, make it implement the ListCellRenderer interface, and attach this to your JComboBox using the setRenderer method.
[This message has been edited by PierreArnaud Galiana (edited June 22, 2001).]
21 years ago
great, thanks !

well, now I'll have to refine my web search methods... or get a better search endurance ; )
21 years ago
How can I set a different width for the arrow button and the popup of a JComboBox ?


I looked at javax.swing.plaf.ComboBoxUI and its subclasses, but it's getting deep in the API, and I have a kind of "the deeper the more dangerous" feeling...
21 years ago