alex d�az

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

Recent posts by alex d�az

Hello:

I have a swing form with a JTabbedPane on it. Whenever I open it, I want the first tab (tab 0) to be visible.

All is fine, this is working. However for the first time the dialog is opened. In this case the dialog opens at the tab pane it was closed on the previous time the application as a whole was executed. I have put default tabbedpane for open selectedindex 0, but it is not working, it is going to open the last tab pane opened.

I've tried several methods to make ensure the dialog is drawn after SelectedIndex has been set to 0 but all to no avail.

Do you know how I can setup tabbepane to start always in tab 0?

I will appreciate your help...

Alex
16 years ago
Ok:

I have a Jtable model with data table [3][3]

I have a button that has specific row and col with values like this:

private void BUTTON_TESTActionPerformed(java.awt.event.ActionEvent evt) {

// here I set values one row and column in the table
int row = 0;
int col = 0;

// Now I want to start editing for example in the row 0 and column 0
mytable.setEditingColumn(0);
mytable.setEditingRow(0);
mytable.editCellAt(0, 0);
}

Usually we start an editing clicking with a mouse over a specific cell in the table. I want to evoid this. I want to start editing in a cell setting the specific row and col from a button and button method call the code edit cell at row 0 and col 0 and the cell will be start to edit (you will see cursor flashing).

The think is that it is not working setting code like I show above.

Thanks...
18 years ago
YES, it is the point...

However when I write the code like you describe here, it is not working.

It is not opening or starting the cell to be edit.

MYTABLE.editCellAt(COUNT, 0);
break;

I need to check only the column 0 in my table and row x, if there is a value compare wrong, this start edit mode in the cell x that need to change value.

However using your code like I show you I have been done, is not working. Nothing success.
18 years ago
Thanks...

Ok, I am using a compare value in a FOR cycle.

I need to check cell by cell from a table and while is checking, this stop looping (like to break the FOR loop) when it got a find a wrong value and then set the cursor inside of the cell that has the wrong value.

This is for make able to user edit the cell.

It is without using double click or whatevet click event.
18 years ago
Hi...

By the way, we usually active a cell using double click over the cell to be

edit.

This is my code for instance my own cell editor:

CELL_EDIT = new myTableEditor();
TABLE.setDefaultEditor(Object.class, CELL_EDIT);.

It is working fine, when I double click over a cell, it start to editing

mode.

However I would like to active the cell editing without double click action.

Like to press a button in the program or a code that say:


// I WANT TO SET VALUES FROM A TEXTFIELD OUT OF THE TABLE BUT INSIDE OF THE

PANEL.

ROW = 2; // whatever that I set
COL = 0; // whatever that I set

CELL_EDIT = new myTableEditor();
TABLE.setDefaultEditor(Object.class, CELL_EDIT, ROW, COL);.

Somebody could help me?

Thanks...
18 years ago
Hello...

I am using netbeans 5 for create fast swing interfaces.

I am creating a JTable for display items, quantity, prices, etc.

I have tried differents ways to align right cells the price columns without be able to get good effort, this continue left align.

I am not sure if there is any condition in netbeans to make able to change the align by column.

If you have idea about this, please, help me.
18 years ago