Masking the value of a cell in a JTable
Hi
I have JTable object which contains 2 columns (name and value). I want to create a table like below.
Name Value
host 12.21.23.12
port 2009
user root
password *****
JTable only allows adding an Object[][] as a row. Now how do I mask the values of the password only such that it does not appear and on the user keyed value is also stored in the tablemodel.
Thanks
BK
Use a cell renderer which does that. I think that having it return a JPasswordField would work. You didn't say whether the table was editable, but if it is then you're going to have to do the same with your cell editor.
(I'm guessing you have never heard of those things, based on the incorrect things you said about JTable in your post. I would suggest going through Oracle's JTable tutorial starting from the beginning and continuing until you get to the part where cell renderers and editors are covered.)
Similar Messages
-
How to read the value of OLAPDataGrid cell/s from external object
Hi,
I have an OLAPDataGrid control in an Adobe flex application,
and I am using the cutom renderer to render the cells of the
OLAPDataGrid ,
any Idea how I can read the value of each cell at the
renderer , so I will be able to decide about the actions for each
cell at the renderer?"j_shawqi" <[email protected]> wrote in
message
news:gkqgdl$539$[email protected]..
> Hi,
> I have an OLAPDataGrid control in an Adobe flex
application,
> and I am using the cutom renderer to render the cells of
the OLAPDataGrid
> ,
> any Idea how I can read the value of each cell at the
renderer , so I will
> be
> able to decide about the actions for each cell at the
renderer?
I'm thinking that you'll need to look at the listData
property. I'm not
sure what you get in an OLAP Grid that orients you to your
cell position,
but I'd set a break point in the listData override of your
renderer and see
what you actually have, or look at the docs for the data type
of the
listData object that the default renderer expects to get.
HTH;
Amy -
Can conditional formatting refer to the value in another cell
Is there a way for conditional formatting refer to the value of another cell instead of entering the value in the conditional format box?
wwjd is right. no way of doing that.
WWJD, two wuestions:
1) do you have the new office 2008 for mac beta (is it out?), how close is it to the new features in Office 2007 for windows, if you do?
2) why do our pictures keep getting cut off after a day of posting. I posted a pic yesterday and its already not showing on the page the next day. Do they not load them after the question is marked as solved?
thanks,
Jason -
Copying the value from a cell in the SQL results?
I run an sql query. The results are returned in a results window. I would like to copy the value from this cell
and paste it into an sql query. How can I do this? I can copy and paste a value from a cell in the view of the data in
a table, but not from the test results. How do I do this? Is there a setting I need to change?I usually do this kind of operations and I've never had any issues, the procedure is as simple as CTRL-C in the results grid, with the required column/columns selected and CTRL-V in the worksheet or anywhere else.
If you still have issues please post your
- SQLDeveloper version
- Java Version
- OS
- Database Version
and if you can a small test case. -
How do I copy the value of a cell?
I'm trying to copy just the value of a cell that contains a formula. I only want to copy the cell that contains the answer and not the other cells that are contained in the formula. Any answers or suggestions would be gratefully appreciated.
Thanks
JQHi jonquant,
Click on the cell that contains the answer.
Edit > Copy (command c)
Click on the cell where you want the value.
Edit > Paste Values.
That will paste the answer without the formulas.
Regards,
Ian -
Setting the footer with the value of a cell - Excel 2010-2013
Hi,
is it possible to set the footer of a workbook with the value of a cell without using VBA code or macro?
ThanksNo; it is not possible to enter a formula that refers to cells in the header or footer. A VBA macro is the only way to set the header or footer to the value of a cell.
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
How to get all the values in one column of a JTable
How to get all the values in one column of a JTable as a Collection of String.
I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.
-
Copy the value of a cell in an other tab.
Hi,
First of all, I'm french. I hope you could understand my poor english.
I've a got a form with a tab where u can ad or sup raws.
I've gat a second tab.
I'd like to copy the value of the cell (textfield) in a cell in the second tab.
I've try "this.rawValue = evolution.forobj.tab1.r1.txt1.rawValue ;" in change event but it doesn't work.
Thanks for your help.
NathHi Nath,
Your English is much better than my French
The change event fires when the user is inputting data into the object that contains the script. As you have it in the change event of the object in tab 2, it does not fire at all when the user is inputting data into the object in tab 1.
Also the change event needs xfa.event.newText and not .rawValue.
I would recommend that you move the script to the calculate event of the object in tab 2. This way as soon as the user leaves the object in tab 1, the information will be undated in the object in tab 2.
Good luck,
Niall
Assure Dynamics -
Hide the value of certain cells in ALV GRID
Hello Gurus,
i need to hide the value or show a icon instead ib certain cells in the ALV GRID for the users that don't have the corresponding rights. Can anyone help?
Regards,
Ioan Constantin.Check this example, you'll need to adjust it to your authority object to run it.
TYPES: BEGIN OF t_alv,
mandt TYPE s_mandt,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
fldate TYPE s_date,
price TYPE s_price,
currency TYPE s_currcode,
planetype TYPE s_planetye,
seatsmax TYPE s_seatsmax,
seatsocc TYPE s_seatsocc,
paymentsum TYPE s_sum,
seatsmax_b TYPE s_smax_b,
seatsocc_b TYPE s_socc_b,
seatsmax_f TYPE s_smax_f,
seatsocc_f TYPE s_socc_f,
planetype2 TYPE s_planetye,
END OF t_alv.
DATA: go_alv TYPE REF TO cl_gui_alv_grid,
gt_sflight TYPE TABLE OF sflight,
gt_alv TYPE STANDARD TABLE OF t_alv,
wa_fl TYPE sflight,
wa_fl2 TYPE t_alv,
gt_fieldcat TYPE lvc_t_fcat,
wa_fcat TYPE lvc_s_fcat.
FIELD-SYMBOLS <gs_fcat> TYPE lvc_s_fcat.
SELECTION-SCREEN BEGIN OF SCREEN 1001.
SELECTION-SCREEN END OF SCREEN 1001.
START-OF-SELECTION.
SELECT * FROM sflight INTO TABLE gt_sflight.
LOOP AT gt_sflight INTO wa_fl.
wa_fl2 = wa_fl.
IF sy-tabix <> 5.
wa_fl2-planetype2 = wa_fl2-planetype.
ENDIF.
APPEND wa_fl2 TO gt_alv.
ENDLOOP.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = gt_fieldcat.
LOOP AT gt_fieldcat ASSIGNING <gs_fcat>.
wa_fcat = <gs_fcat>.
IF wa_fcat-fieldname = 'PLANETYPE'.
wa_fcat-fieldname = 'PLANETYPE2'.
wa_fcat-col_pos = 7.
AUTHORITY-CHECK OBJECT 'ZPERMISO16'
ID 'ZPERMI' FIELD '01'.
IF sy-subrc = 0.
wa_fcat-tech = 'X'.
wa_fcat-no_out = 'X'.
ELSE.
<gs_fcat>-tech = 'X'.
<gs_fcat>-no_out = 'X'.
ENDIF.
APPEND wa_fcat TO gt_fieldcat.
ENDIF.
ENDLOOP.
CREATE OBJECT go_alv
EXPORTING
i_parent = cl_gui_container=>screen0.
CALL METHOD go_alv->set_table_for_first_display
CHANGING
it_outtab = gt_alv
it_fieldcatalog = gt_fieldcat .
CALL SELECTION-SCREEN 1001. -
How to write a formula that includes the value of a cell from another external numbers file ?
Hello,
Maybe my Numbers is too old : Numbers '08 v 1.0.3
But it doesn't seem to allow me to write a formula that includes the value of an external cell...
Any answers ?
Upgrading to Numbers '09 ?
Thanks !Olivier,
Be sure to Send Feedback to Apple using the Feedback tool in the Numbers menu. That will help the Numbers design team prioritize their feature requests for the next version.
Jerry -
Modify the value of a cell in an ALV. Rewarding points.
Hello Gurus, i am modifying the value of a certain cell in the internal table that is displayed in the ALV using the data_changed event, but when i refresh the ALV the values shown are the old ones.
Help.Hello Ioan
Unfortunately you do not explain you scenario clearly enough. Therefore I must do some speculations.
You have an editable ALV list. The user can change data but not field USNAMECH which might be the user who changed the data.
A big question is how the CHECK_DATA_CHANGED event is raised. Perhaps you have registered the EDIT event (method REGISTER_EDIT_EVENT). Then the scenario would look like this:
1. User changes data and pushes the ENTER button.
2. Since the EDIT event is registered this triggers event CHECK_DATA_CHANGED.
3. In event handler method ON_DATA_CHANGED you enrich the changed data with the name of the current user.
4. And now you need to push this data back to your ABAP.
If this is your scenario then just trigger PAI from within your event handler method ON_DATA_CHANGED:
METHOD on_data_changed. "xxx
modify itab index mod_cells-row_id from wa_itab transporting USNAMECH disponibilrag.
"CALL METHOD grid->refresh_table_display.
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DUMMY'
* IMPORTING
* rc =
ENDMETHOD.
MODULE USER_COMMAND_nnnn PAI.
CASE gd_okcode.
WHEN 'BACK' OR
'EXIT' OR
'CANC'.
set screen 0. leave screen.
WHEN 'DUMMY'.
" Do nothing here or perhaps call method:
" CALL METHOD grid->refresh_table_display
" Yet should not be necessary.
WHEN others.
ENDCASE.
ENDMODULE.
Regards
Uwe -
How to get the value from a cell in jTable without click "enter" or "tab"
Hi guys,
I have a simple question. I have a jTable in my screen and when editing a value, but without click "enter" or "tab" I want to get the new value. I have a button update and after editing the value I click the button "update" and I want the new value to be store in my table. If try to get the selected value it is giving the old value. How can I implement this? Any idea? I hope I was clear.
Thanks[Table Stop Editing|http://www.camick.com/java/blog.html?name=table-stop-editing]
-
How can i pull the value of one cell into the cell of another table?
I want to pull the value (the result of a =SUM(x) formula as the starting value of a column in another table. How can I do that?
Yvan KOENIG (VALLAURIS, France) vendredi 10 février 2012
iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k -
How to compare the value of a cell before changing and after changing.
Hey there,
Now I want to implement a JTable. And the requirement is that users can edit a cell in the Table only once. I think there are two possible ways. One is that after user edited a cell, I will set this cell read only. Another way is to compare the vaule before and after the changing. If it is different, then write back the previous value.
But I did not know how to implement in Java. Can anybody help me?
Thanks alot!
Shellyinevitably, you will have to save a before copy of
the data, what this many times amounts to is that you
will need to have 2 identical data structures before
you start or some type of locking mechanism for each
piece of data.Why is this inevitable? I don't see it as inevitable at all. In fact, it's quite simple to implement a TableModel that returns false when isEditable(int, int) is invoked for any cell that has already had setValueAt(Object, int, int) inovked on it, for example. Depending on the requirements and implementation a different methodology may be needed for determining when the edit has taken place, such as a custom editor that notifies the TableModel when stopCellEditing() is invoked. Heck, overriding editingStopped() in JTable to do it might even work.
So, create a TableModel that returns isEditabe(int, int) as true only if the cell hasn't been edited yet. The only problem to solve from there is how you know when it's been edited. I've already given you a few leads on that, it's not particularly hard but depending on your exact implementation it may require different solutions. -
How do I display an image in Numbers based on the value of another cell?
Here is the situation. I have a list of names in one table. I then have a table of pictures of corresponding to each name. I then have a drop down list in a cell with each of the names in it. I would like to be able to click the drop down list, select a name, and then have the corresponding picture be displayed in a cell. How would I go about doing this?
Late 2013 rMBP with fully up to date software.not possible. I have wanted to do this myself. You can post feedback to Apple using the menu item "Numbers > Provide Numbers Feedback"
Maybe you are looking for
-
Basically, I took a ton of pictures at past concerts, formal events, etc. So I need something to transfer all of those pictures onto. I currently have 9.1 GB of photos in my iPhone which really limits me on phone space. I would like to save these pho
-
Event handling in AJAX Blueprints Maps
I am trying display various information in a text box based on the map marker selected. I see that you can bind an individual map marker to the info, but is there any way to dynamically set the info based on the selected map marker?
-
Bootloader errors during install on Macbook 7,1
I had Arch up and running on my Macbook 7,1 with / and /home partitions, and decided that I wanted to make /home larger. For some reason, it didn't occur to me to just resize my /home and OS X partitions, so I backed up and wiped Arch off my disk ent
-
Hi, I need to post FI doc in two CC. I mean, after posting in first CC, the same doc should be transfered to another CC. I see that I can use document splitting, but I don't have new GL. Please pay attention that I want to use only FI docs and I don'
-
What is the support telephone number? Regards, Rick Vranesh