alejandro garcia

Greenhorn
+ Follow
since Aug 11, 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 alejandro garcia

Hi! I hope someone could help:
I defined a BoxLayout JPanel because I need to show in this order:
a checkbox
a textfield
another checkbox
another texfield

and this works fine:

JPanel jPanelBoEx = new JPanel();
jPanelVars.add(jPanelBoEx, BorderLayout.LINE_START);
jPanelBoEx.setLayout(new BoxLayout(jPanelBoEx, BoxLayout.PAGE_AXIS));

jPanelBoEx.add(jchkbox1);
jPanelBoEx.add(jTextField1);
jPanelBoEx.add(jchkbox2);
jPanelBoEx.add(jTextField2);

But I need not to show them in the center, they must be shifted some position to the right so I use this:

jPanelBoEx.setBorder(BorderFactory.createEmptyBord er(0, 160, 0, 0));
To shift the four of them to the right, but I need the two textfields to be more to the right than the 2 checkboxes..

But I can't find how to "move" the textfields to a different position than the checkboxes..
Thanks in advance.
11 years ago
Hello, in this code suppose that the dlg is defined in one case as a JDialog, I run it and it seems that the JDialog is executed AFTER closing it, so the message is printed after closing the JDialog.
But when I run the code with dlg defined as JPanel it prints the message before I close the JPanel.

And I need the JPanel to behave like the JDialog in that sense.. how could I deal with this?
Thanks in advance




12 years ago
Hi! I've been trying to let the end user change the language of a menu. It's almost done, now I have a Menus class showing 3 items : File Help and Description
In the File item you click in Configuration and there is the combo box where you select the language, you select for example Spanish and click the button and it changes the language of the 3 items above (File,Help and Description).
To do that I have a Selector class where I declare the Locales and an updateString method that I call after setting the Resources. So far so good

Now in the Description item I have a subitem named Test and in Test there's a panel named Conver with just some labels and a button, I'm trying to change the language of this panel too in my Configuration panel but does not work ...
Here are the classes:







12 years ago
Hi! here I've got a Selector class which shows a combo box and a label, in the combo box the user can select the language in which he wants the label to be showed, getting the translation from the Datos.PROPERTIES file.
That works fine.

Now I need to extend it so that this selection class selects the language of all the menues of an application.

The question is: do I have to add all the labels of the application in the if-then-else sentence of the selection class?
I mean that in the selection class I show here there's an if then else sentence depending on the language selected, do I have to put all the labels of all the menues of the application in there?

12 years ago
Hi! I'm new to Java but I was given a 300 classes system that I need to understand and modify. When I try to follow the logic I get lost, I even can't find in which class is defined the method that is called because each class imports many others.
It would help me very much if there could be some tool to build some kind of flowchart or classes diagram to visually show who calls who..
12 years ago
I don't understand: I can't remove this line
JComboBox langList = new JComboBox(langStrings);
from the initComponents()

and I can't remove this attribute from the class:
private javax.swing.JComboBox langList;


12 years ago
didn't work
Now I run this:
javax.swing.JOptionPane.showMessageDialog(null,"Hello");
and got the same error
12 years ago
Hi! I'm trying to show the item selected in a combo box with getSelectedItem(), when the user clicks the button I just try to show the item with showMessageDialog, but it selects nothing and I can't find out why, could anybody help please?


12 years ago
Hi, I'm trying to make the user select the language of a very simple menu.
I post here the 2 classes: Menus and Selector.
In the Menus class, there are 2 items: File and Help
When you click on File then you select Configuration, and it shows the Selector class which is only a ComboBox, where you select the Language.

The Menus class is in part internationalized because I defined a Resources.properties file with this pairs:

TITLE=Internationalization!
FILE=File
HELP=Help
OPEN=Open
CONFIGURATION=Configuration

So that's first step is done, and it works fine, now I need the end user to select the language in the Configuration combo box and on the fly load TITLE, FILE,HELP,OPEN and CONFIGIRATION from an appropiate Resourses_es_ESP.properties file that I've already created, if for example he selects Spanish, that properties file has this pairs:
TITLE=Internationacionalizacion
FILE=Archivo
HELP= Ayuda
OPEN=Abrir
CONFIGURATION=Configuracion.

Any help please?

Here is the menu class just to select the Configuration option:




And here is the selector it's just a combo box to select the language

12 years ago