How to set a JRadioButton as a column in a JTable
Hello Friends,
I need a help in JTable.
I want to have a Radio button as a column of a JTable.(The Other Columns should be Strings).
The heading of the Column which has the RadioButton is "Select" which means that I can select only one radiobutton at a time.
Could you please give me a solution on this.
I would appreciate if u give me the code for this, as it is very urgent.
Thanks in Advance,
Regards,
Vijayakannan
Hi,
use a TableCellRenderer and CellEditor as described in http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
Propably you need to track the selected button yourself, e.g. by using an int value representing the row selected.
Similar Messages
-
How to set default values for boolean columns
I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
I've tried to set default value at column level:
<Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
<Default>TRUE</Default>
</Field>
and at content type level:
<FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
But in any case, when i create a new item with this content type, default value is applied.
Can anyone tell how to set default values for boolean columns?
Thanks in advance,
Regards,
SergioIn the field definition you can set
<Default>1</Default>
or
<Default>0</Default>
How to set the default value Null? -
How to set default value in matrix column
Hi all,
Does any one know how to set a default value in matrix column ?. I just want , when an event right click and add row. so i set a default value in a column field for example 'Test'. FYI the matrix is in the UDO.
so my code will be like this
If pVal.ItemUID = "Matrix" And pVal.MenuUID = "1292" Then
Try
Dim oColumn As SAPbouiCOM.EditTextColumn
Dim matrix As SAPbouiCOM.Matrix
matrix = oForm.Items.Item("Matrix").Specific
oColumn = mat.Columns.Item("Code").specific
oColumn.Value = "Test"
Catch ex As Exception
Debug.Print(ex.Message)
Debug.Print(ex.ToString)
End Try
End If
I have run it and when i right click and add row it still can not set the default value in one of the matrx column.
does any one know how to solve it. thanks in advanceHi Bodhi
Sandeep is right you can set value using SetValue() function
If pVal.ItemUID = "Matrix" And pVal.MenuUID = "1292" Then
Try
Dim matrix As SAPbouiCOM.Matrix= oForm.Items.Item("Matrix").Specific
oForm.DataSources.DBDataSources.Item("UDT").Clear()
matrix .AddRow()
matrix .FlushToDataSource()
With form.DataSources.DBDataSources.Item("UDT")
.SetValue("UDF", matrix .RowCount - 1, "Test")
End With
matrix .LoadFromDataSource()
Catch ex As Exception
Debug.Print(ex.Message)
Debug.Print(ex.ToString)
End Try
End If -
How to set when press Tab in column matrix, then it will show a list
Hi
I want to my form exactly as Sales order, so when I press Tab in item No (on sales order) column it will show list of item
So I want to create my own form with matrix, and in the first column I want to set Tab event, so when I press Tab in that column it will shown list of something from database.
how to get an event Tab in column matrix ??
and what object in the list of item form (on sales order) ?? matrix or grid or something else ??
ThanksHi,
Linking a ChooseFromList to the matrix column should give you what you want. Samples of using the ChooseFromList can be found in the SDK HelpCenter and here in the SDN forum. For example:
choosefromlist in the fields of a matrix
Kind Regards,
Owen
P.S. Please note, you have posted this question in the general SAP Business One forum. Your question is more about development so I would recommend you post in the SAP Business One SDK forum rather than here. -
How to set different renderers to same column
I am trying to set different renderer to same column.
table.getColumn("columnname").setCellRenderer(
FirstCellRenderer);
table.getColumn("columnname").setCellRenderer(SecondCellRenderer);
I want both to work at the same time.
It is taking the second renderer but not first.
Can anyone please help me, how can i achive it.In my situation i need first renderer for all the columns in the table.
Second renderer only for one column.(which shows thw column value as tooltip)
Can you please tell me how can i do it.
when i tried to consolidate in one renderer , it is showing me the same value to all the columns. -
Help on how to set value on LinkButton type column
Hello,
Can I programmatically set a value on Item No. in matrix on Sales Quotation which is of type SAPbouiCOM.LinkedButton?
This code helped me set values to an edittext type column
Dim et As SAPbouiCOM.EditText = oMatrix.Columns.Item(matrixColumnID).Cells.Item(rowNumber).Specific
et.Value = value
Dim et As SAPbouiCOM.LinkedButton = oMatrix.Columns.Item(matrixColumnID).Cells.Item(rowNumber).Specific
How can set value for the Item No.?
Thanks and Regards,
SheetalJust treat the Item No. column as an EditText for purposes of setting its value.
Dim sboEdit As SAPbouiCOM.EditText
Set sboEdit = sboMatrix.Columns("1").Cells(lngRow).Specific
sboEdit.Value = "XXXXXX"
John. -
How to set Oracle username to a column .
Hi Everyone,
i have a table with some columns for example: ROW_CREATED_BY,ROW_CHANGED_BY we have to set Oracle username in trigger
i.e., i have a trigger
create or replace
TRIGGER "EMP_TRG" BEFORE INSERT OR UPDATE ON EMPLOYEE FOR EACH ROW
BEGIN
If inserting then
if :new.ROW_CREATED_BY is NULL then
:new.ROW_CREATED_BY := *?;*
end if;
END;
we can make use of V$SESSION.USERNAME, how to set this in trigger
can we write :new.ROW_CREATED_BY := V$SESSION.USERNAME;
since i didnt have permission to acess V$SESSION table or any other approch to set Oracle username to a column
Please NeedHelpFulThe USER-Function gives you the name of the currently logged in user.
Are you looking for this?
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions207.htm#sthref2462
you could directly use it in your trigger like this:
create or replace
TRIGGER "EMP_TRG" BEFORE INSERT OR UPDATE ON EMPLOYEE FOR EACH ROW
BEGIN
If inserting then
if :new.ROW_CREATED_BY is NULL then
:new.ROW_CREATED_BY := USER;
end if;
END; -
How to set the Selected row and Column in JTable
Hi,
i have a problem like the JTable having one Method getSelectedRow() and getSelectedColumn to know the Selected row and Column but if i want to explicitly set the Selected Row and Column,then there is no such type of Methods.If anybody has any solution then i will be thankful to him/her.
Praveen K SaxenaIs that what you're looking for? :myTable.getSelectionModel().setSelectionInterval(row, row);
myTable.getColumnModel().getSelectionModel().setSelectionInterval(column, column); -
Setting the Size of a Column in a JTable
Hi there,
does anybody knows a way how to set the size of a specified column in a JTable without changinge the size of the other columns?
thx anyway
ErrraddicatorYou've got to change the JTable's column resizing policy to prevent the other columns resizing:
JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF)Otherwise all the columns will be adjusted to fit into the width of the table - changing one column would have to result in at least one other column changing!
Hope this helps. -
How to set different font for a particular row in jtables?
How to set different font size and font type for a particular row in jtable?
More than enough sample code here:
[http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
db -
How to fix the value of first column in the JTable in java swing for every
Hi ,
I have a swing page that have table panel in which there is a table of size 7x4 now when I click on the perticulat row then that row data will displayin the table like that the selected row become the second column in the new table and the fist column of this table will remain constant for all the entry but the second column update according to the roe which is selected .How it is possible .
Thanks in Advace,
anuOne thing you can do is to prevent the user from editing that column and programatically supply the values of that column yourself.
JTable table = new JTable() {
public boolean isCellEditable(int row, int col) {
if(col == 0) {
return false;
return super.isCellEditable(row, col);
};This allows you to prevent the user from editing the column information so you can supply some sort of a default value for the column always
ICE -
How to set color for a particular column in advance table?
How can we set the color of a particular column in advance table based on some parameter feteched from vo query in process request?
i have tried the same way as mentioned in the post but ,its giving error
java.lang.ArrayIndexOutOfBoundsException: 0
processRequest code
OAAdvancedTableBean table =
(OAAdvancedTableBean)webBean.findIndexedChildRecursive("TimEntAdvtbl");
if (table != null)
System.out.println("table");
OAColumnGroupBean daily =
(OAColumnGroupBean)table.findIndexedChildRecursive("DailyColGrp");
if (daily != null)
System.out.println("daily col");
OAColumnGroupBean ColGrp6 =
(OAColumnGroupBean)table.findIndexedChildRecursive("ColGrp6");
if (ColGrp6 != null)
System.out.println("ColGrp6");
OAColumnBean SatCol =
(OAColumnBean)webBean.findIndexedChildRecursive("SatCol");
if (SatCol != null)
System.out.println("col");
OAMessageTextInputBean sat1 =
(OAMessageTextInputBean)SatCol.findIndexedChildRecursive("sat");
if (sat1 != null)
System.out.println("sat1");
OADataBoundValueViewObject csssat= new OADataBoundValueViewObject(sat1,"Color");
sat1.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, csssat);
Error Page
## Detail 0 ##
java.lang.ArrayIndexOutOfBoundsException: 0
at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:3199)
at oracle.sql.NUMBER.toString(NUMBER.java:761)
at oracle.sql.NUMBER.stringValue(NUMBER.java:2090)
at oracle.jbo.domain.Number.toString(Number.java:390)
at oracle.apps.fnd.framework.webui.OADataBoundValue.formatObject(Unknown Source)
at oracle.apps.fnd.framework.webui.OADataBoundValue.convertValue(Unknown Source)
at oracle.apps.fnd.framework.webui.OADataBoundValue.convertValue(Unknown Source)
at oracle.apps.fnd.framework.webui.OADataBoundValueViewObject.convertValue(Unknown Source)
at oracle.apps.fnd.framework.webui.OADataBoundValue.getValue(Unknown Source)
at oracle.apps.fnd.framework.webui.OADataBoundValueViewObject.getValue(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.getAttributeValueImpl(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean.getAttributeValueImpl(Unknown Source)
at oracle.cabo.ui.BaseUINode.getAttributeValue(Unknown Source)
Please help -
How to set the width of a Column
Hi friends
I have problem with setting up the Width for each column. Let us i want to set different column width for each Column.
That is for first column the Width may be Different and the other column the width may be different.
So please help me out on this Issue
Cheers
JofinHow to set the width of a ColumnWhat component are you talking about? Are you talking about the width of a column in a JTextPane?
Have you read the API for the component in question?
Have you followed the link titled "How to Use...." to the Swing tutorial?
Learn to read the API and ask a proper question with all the relevant information. -
How to set Destination URI of a column in a multi row table
Hi,
I need to programmatically set the destinationURI property of a 'messageStyleText' column in a multi-row table.
I have used the below code in the processRequest of the Controller of the page:
OAViewObject viewObject = (OAViewObject)am.findViewObject("IntSummBackOrdDetVO");
String url = (viewObject.getCurrentRow().getAttribute("ErrorCode")).toString();
url = "/oiphtml/o2c22_"+url+".htm";
OAStaticStyledTextBean errorlink = (OAStaticStyledTextBean) webBean.findChildRecursive("ErrorCode1");
errorlink.setDestination(url);
But this code is not working. Could you please help me in correcting the above code?user594528 ,
What ur trying to do can be conceptually possible through bound values only as there are many rows in table.Read bound values section in dev guide, to understand the fundamentals.
You can refer to thread to correct ur code:
Re: Unable to set Destination URI to URL stored in a VO attribute
--Mukul -
How to set the value of the column as the value of other table coulmn.
dear friends
i have a table SO_D having coulm (so_no,item_cd,qty,rate,unit)
and anather table so_tax(so_no,tax_code,tax_percent,tax_amt,item_cd,flag)
now i have ALL VALUES in the first table i.e so_d
but in table so_tax i have all values except item_cd.
the values in the so_tax table comes from so_d by the formula ((qty*rate)*percent(which in so_tax table))/100) corresponding to each item_cd
here so_no and item_cd are primary key in so_d and foreign key in the so_tax.
and for each so_no the item_Cd is unique and my repeat for new so_no in the table so_d.
now i have the problem that in the table so_tax the value in the coulmn item_cd is blank .
but the tax amount is calculated for each item_cd .
now i want to update the table with the item_Cd values ad they are in the so_d table according to the tax amount calculated by using above formula.
please suggest the solution..
any query please ask
i can provide values for the each table..
thanks in advanceData sample for the table so_d is
SO_NO ITEM_CD QTY RATE UNIT
AT0064 12000135 15 22163 NOS
AT0064 12000136 15 20337.82 NOS
AT0064 12000137 15 21902.27 NOS
AT0064 12000138 15 20337.82 NOS
AT0064 12000139 15 20337.82 NOS
AT0149 CO000109 2 20755 NOS
AT0149 CO000110 1 2502 NOS
AT0149 CO000111 1 2502 NOS
AT0149 CO000112 1 2502 NOS
AT0149 CO000113 1 9328 NOS
AT0149 CO000114 1 15476 NOS
AT0149 CO000115 1 82150 NOS
AT0149 CO000116 1 2915 NOS
AT0149 CO000117 1 11766 NOS
AT0149 CO000118 1 2968 NOS
AT0149 CO000119 1 2968 NOS
AT0149 CO000120 1 3286 NOS
AT0149 CO000121 1 7950 NOS
AT0149 CO000122 1 1908 NOS
SAMPLE DATA FOR SO_TAX
SO_NO TAX_CODE PERCENT AMT ITEM_cD FLAG
AT0064 X02 4 13297 Y
AT0064 X02 4 12203 Y
AT0064 X02 4 13141 Y
AT0064 X02 4 12203 Y
AT0064 X02 4 12203 Y
AT0149 V16 14.5 6018 Y
AT0149 V16 14.5 363 Y
AT0149 V16 14.5 363 Y
AT0149 V16 14.5 363 Y
AT0149 V16 14.5 1353 Y
AT0149 V16 14.5 2244 Y
AT0149 V16 14.5 11912 Y
AT0149 V16 14.5 423 Y
AT0149 V16 14.5 1706 Y
AT0149 V16 14.5 430 Y
AT0149 V16 14.5 430 Y
AT0149 V16 14.5 476 Y
AT0149 V16 14.5 1153 Y
AT0149 V16 14.5 277 Y
HERE ITE_CD IS BLANK
Maybe you are looking for
-
Multiple Corner Types (Miter, bevel, round) in one path
I'd like to be able to have multiple types of corners within one path. I'd like to have a path where the first point is a bevel corner type, the second point is a miter corner and the third is a bevel again. Of course switching between any corner typ
-
Access Custom Configuration Item Class property in Data Warehouse database
Is there a way to access properties on a custom 'Configuration Item Class' in the DW database? When creating a new CI class eg. 'Monitors' and extending this with a property like 'Serial' is there a way to access this in the DW database? I can find D
-
hi all, basically i am mm consultant ,now I am alloted a new project in DMS module.Please help me in getting the following.. 1. SAP DMS Business Blueprint 2. Question - Answer Database of Client. my mail [email protected] useful help awarded be sure.
-
Hello frens.... I am using Jakarta Slide API. In webDavResObj.updateMEthod(String path??,String target??) does the parameter path mean the path of the file to be updated and target means the path to where the file has to be redirected?? I gave the pa
-
ITunes downloaded songs it said I already purchased
So I just downloaded the new St. Lucia album, and next to 5 songs that I already bought as singles or other EPs, said "Purchaced" so I did "complete my album" however, out of those 5 songs, iTunes decided to redownload 3 of them, even though it said