Check a checkbox in a jtable in a panel from another panel

I have a panel-> Panel A
where I have some conditions and on that condition I want to check a checkbox in a jtable in another panel ->PanelB
So Panel B has a jtable with one column as checkbox,I want to check/uncheck this checkbox based on some conditions in some other panel A
I have no idea how to do this.Please help.
Thanks

885522 wrote:
How will the change be reflected dynamically if the value changes in some other panel.By code that you write. If you want component X to change based on some changes to component Y, then first you set up a listener which will notify you when changes to component Y take place. In that listener you put code which makes the appropriate changes to component X, based on what happened to component Y.

Similar Messages

  • How to refresh a JTable of a class from another thread class?

    there is an application, in server side ,there are four classes, one is a class called face class that create an JInternalFrame and on it screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write??
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

    Use the "code" formatting tags when posting code.
    Read this article on [url http://www.physci.org/codes/sscce.jsp]Creating a Simple Demo Program before posting any more code.
    Here is an example that updates a table from another thread:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=435487

  • Help! how to refresh the JTable of a class from another thread class

    there is an application, in server side ,there are two classes, one is a class called face class that screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much

    thank you very much !
    i tried it ,but the TableModel i used like this ,and how to change the TableModel?
    here the files of mine ,pls give me some help,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write?? }
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

  • Problem : Not able to select multiple checkboxes in the JTable

    Here i am trying to select the multiple check boxes in the jtable. But i am not able to do that. I set the jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); also.
    Can any one help on this...

    [email protected] wrote:
    Here i am trying to select the multiple check boxes in the jtable. But i am not able to do that. I set the jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); also.
    Can any one help on this...That's row selection, not check boxes. The normal way to have active checkboxes in a JTable is with an editable Boolean column. The effect of clicking such a checkbox is to cause the table to call setValueAt() in the data model with a Boolean object value, and it's up to the data model to deal with that change.

  • Exception -arrayindexoutobound  while inserting checkbox in a jtable

    hello,
    i am using oracle as backend. As you might be knowing that oracle doesn't store boolean datatype.
    so now please tell me how to insert checkbox in a jtable.
    please do help me if you can.

    HELLO camickr
    ONE INTERESTING THING IS HAPPENING->
    i had created 2 table in my form 1) jtable1 2) jtable2
    i had declared the listener on JTABLE1 as->
    jTable1.addMouseListener(new Mousehandler())
    I HAD WRITTEN THE METHOD AS->
    public class Mousehandler extends MouseAdapter
    public void mouseClicked(MouseEvent me)
    //NOTE ->HERE IS THE CODE TO ADD CHECKBOX ON A COLUMN FOR JTABLE1
    TableColumn sport= jTable1.getColumnModel().getColumn(1);
    // str=jTable1.getCellEditor();
    JCheckBox jCheckBox1 = new JCheckBox();
    sport.setCellEditor(new DefaultCellEditor(jCheckBox1));
    //NOTE-> HERE IS THE CODE TO ADD JCHECKBOX ON A JTABLE2
    TableColumn sportcol = jTable2.getColumnModel().getColumn(1);
    JCheckBox jCheckBox2 = new JCheckBox();
    sportcol.setCellEditor(new DefaultCellEditor(jCheckBox2));
    now when i click on JTABLE1 IT IS THROWING EXCEPTION BUT WHEN FUNCTIONING WITH jTable2 WHEN I CLICK ON THE COLUMN IN WHICH I HAD INSERTED CHECKBOX IT IS FUNCTIONING PROPERLY WITHOUT ANY ERROR.
    NOTE-> I HAD TO CLICK ONCE ON JTABLE1 THEN ONLY JTABLE2
    FUNCTION BECAUSE I HAD DECLARED LISTENER FOR JTABLE1 ONLY.(JTABLE1 IS THROWING AN EXCEPTION ARRAYINDEXOUTOFBOUND when i click on the column in which i had inserted jcheckbox im my jtable1)
    PLEASE DO HELP ME IF YOU CAN.
    THANK YOU.

  • How to check a checkbox field value in fw9 PDF form

    Hi,
    I got a PDF given form IRS (http://www.irs.gov/pub/irs-pdf/fw9.pdf). While creating a widget to this pdf form to sign it, I merged the custum data to those PDF form fields using API setMergeFields.
    All the data fields are merged fine except the checkboxes. I tried by passing the values to the merge_fields array as 'On', '1', 'checked', 'checkbox(checked)' but no luck
    What is wrong here in checking the chexbox field in this fw9 PDF or How to check a checkbox field in a form?
    Thank you,

    Hi Simon,
    I re-added and edited the fields of fw9 form by pdf printer. While doing so, I made fields as ready only so that, the data cannot be edited in the form through the widget but will be merged the data to fields only be the code. Wherein Im using the widget only for signature but not for form filling.
    Here, Im able to merge my custom data to all fields while creating widget but not to the fields of checkboxes. The checkboxes fields which are made ready-only are not allowing me to merge the value as checked by the API.
    Please help me,
    Thanks you,

  • Set default value for people picker only when user checks a checkbox (Sharepoint 2010)

    The javescript in below link works for me.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/2b130f64-3db2-484a-9a53-ccbe18d2c5de/set-default-value-for-people-picker-in-list-template-current-user?forum=sharepointgenerallegacy
    However, I'd like to set default user for people picker only when user checks a checkbox. 
    I am new to  development. Could you please help me on this requirement ?
    Thank you very much. 

    Hello,
    Use this link to to validate checkbox value, if true then set the person or group value (i.e. as posted in your link).
    http://geekswithblogs.net/haniamr/archive/2011/03/10/validate-that-a-checkbox-is-checked-using-javascript.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to check a checkbox

    Hello,
    I am using the interapplication communication API classes from my c# program. I read an  previously generated xml and write the data to the live cylce pdf form
    I use the below classes and use the IField.value( myField.Value = xmlcolValue;) to write to the form. It works fine for all the text boxes, But is not writting/selecteing/checking  the checkboxes.
    I have tried using the IFeild.setExportValues(..) but it gives me an error "Security setting prevent me from doing that".Could you please let me know how to solve this issue?
    CAcroAVDoc  
    Thank you
    IAFormApp  IFields   IField

    Hello,
    Still searching for the same issue. Does anyone have a solution/fix for this?
    Thanks

  • Check teh checkboxes on click of button

    Hi,
    I am using mvc bsp application.
    I have a button "select all" . upon clicking this button i need to check certain checkboxes.how do i do this using onclientclick and javascript?
    Regards,
    niky.

    <af:commandButton partailSubmit="true" id="cb1" actionListener="#{Bean.doAction}">
    <af:inputText partialTriggers="cb1" visible="#{Bean.flag}">
    in the bean have it like
    private boolean flag; //have getter and setter
    public void doAction(ActionEvent actionEvent){
    flag=true;

  • How to check whether checkbox is checked or not and to get label if checked

    Hi,
    I've used checkboxgroup, and i'm populating it dynamically using attribute node & attribute value.. like this
    IPrivateTestView.IWelcomNode wNode =wdContext.nodeWelcom();
         IPrivateTestView.IWelcomElement wEl,wE2,wE3;
         wEl=wNode.createWelcomElement();
         wNode.addElement(wEl);
         wEl.setWelValue("Welcome Boards");
         wE2=wNode.createWelcomElement();
         wNode.addElement(wE2);
         wE2.setWelValue("Traditional Welcome");
         wE3=wNode.createWelcomElement();
         wNode.addElement(wE3);
         wE3.setWelValue("Photograph");
    now i want to check whether checkbox is checked and how many checkbox has been checked and then i want that label values of checked boxes.. so pls help me out. if possible give me some sample coding...

    CheckBoxGroup.texts -> Welcom.WelValue
    In controller method (e.g. action handler):
    IWelcomNode node = wdContext.nodeWelcom();
    for (int i = 0; i < node.size(); ++i)
      IWelcomElement e = node.getWelcomElementAt(i);
      if (node.isMultiSelected(i))
        String text = e.getWelValue();
        /* checkbox #i is selected and variable "text" contains the text */
    Armin

  • Disabling input text component on checking the checkbox

    Hi,
    I have created INPUT TEXT and CHECKBOX dynamically by the following code.
    List<UIComponent> children;
    children = pgl.getChildren();
    RichPanelGroupLayout pgll;
    pgll = new RichPanelGroupLayout();
    pgll.setLayout("horizontal");
    List<UIComponent> children1;
    children1 = pgll.getChildren();
    RichInputText it;
    it = new RichInputText();
    UIComponent cb = new RichSelectBooleanCheckbox();
    children1.add(it);
    children1.add(cb);
    children.add(pgll);
    Now on checking the checkbox i shud disable the inputtext box.. can someone help me out in getting it?

    In the valueChangeListener of the checkbox, set the disable propoerty of the input box to true and call the partial trigger on the input box using AdfFacesContext.addpartialTarget("idoftheinputbox"). Also set the partial submit of the checkbox to true.

  • Check a checkbox with condition

    Hi expert,
    I'am new in visual compser, I'am triying to check a checkbox folowing a condition. If the condition is satified, so check the chekbox.
    Any idea ?
    Cordialy

    Hi,
    Please be aware that in 731SP14 there is an issue in webdynpro runtime and also in VC5 that this thing is not working. We are aware of the issue and working on that.
    What you can do as a workaround if it does not work, is to create an action from the text field/button/plain text or any other control that determines the checkbox status. This action will set value of true or false to the checkbox accroding to your condition- that depends on the value of the textfield /plain text etc..
    Regards,
    Asaf.

  • Check/Uncheck checkbox

    Hi all !
    I am having  a problem wich is very simple to solve but I haven't managed yet  to accomplish that ... When I check a checkbox I previously added to my Items Form I want to deactive Sales Item checkbox .Currently my code is :
    If (pVal.FormType = 150 And pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.ItemUID.CompareTo("rental") = 0) Then
                Try
                    oDocPrintForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                    check = oDocPrintForm.Items.Item("rental").Specific
                    If (check.Checked) Then
                        oCheckbox = oDocPrintForm.Items.Item("13").Specific
                        oCheckbox.Checked = False
                    Else
                        oCheckbox = oDocPrintForm.Items.Item("13").Specific
                        oCheckbox.Checked = True
                    End If
                Catch ex As Exception
                End Try
            End If
    It is not working correctly . it only works on the first time ... Any hint
    Regards,
    Ivan Frias

    Hi !
    when i had the problem in past the reason was the wrong event.
    you check the clickevent but try
    pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
    lg David

  • When I checked a checkbox, I also want to be checked other checkbox...Help!

    When I checked a checkbox, I also want to be checked other checkbox... How can I do this? Thank you...

    Hello,
    I Think you want to check the detailed block's checkboxes.
    For that, try this in the WHEN-CHECKBOX-CHANGED Trigger of the main block's checkbox.
           IF :<main_block_name>.<checkbox_name> = <value_when_checked> THEN
              GO_BLOCK('<detailed_block_name>');
              FIRST_RECORD;
              LAST_RECORD;
              Num_Total_Records := TO_NUMBER(NAME_IN('SYSTEM.CURSOR_RECORD'));
              FIRST_RECORD;
              FOR Num_Loop_I IN 1..Num_Total_Records LOOP
                   :<detailed_block_name>.<checkbox_name> := <value_when_checked>;
                   NEXT_RECORD;
              END LOOP;
         END IF;Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • Dynamically checking off checkboxes

    Hi,
    I have a simple form with some checkboxes.  The user checks them off and the values get store in a db.
    I like to eat:
    Form page:
      <input type="Checkbox" name="fruit" value="apples">apples ....
    - apples
    - oranges
    - bananas
    - grapes
    So on the edit page if the user has checked off all, but oranges it should be displayed from the db like so:
    x apples
    - oranges
    x bananas
    x grapes
    I started by doing this, but it doesn't quit cut it.  Maybe merging the values of the form fields and the db fields into one list would work?
    <cfoutput query="getinfo">
             <cfif fruit EQ '#fruit#'>
             <input type="Checkbox" name="fruit" value="#fruit#" checked>x apples
             <cfelse>
             <input type="Checkbox" name="fruit" value="#fruit#" >apples
    </cfoutput>
    Any ideas would be much appreciated!

    Database table: fruitChoice
    userID apple orange banana grape
    x147d
    1
    0
    1
    1
    a065b
    0
    1
    1
    1
    t992w
    1
    0
    1
    0
    Query to fetch data from the database:
    <cfquery name="getInfo" datasource="myDSN">
    select apple,orange,banana,grape
    from fruitChoice
    where userID = '#session.userID#'
    </cfquery>
    Query to insert data into the database:
    <!--- I use the submit field, not a checkbox, to verify whether the form has been submitted. If you don't check a checkbox, x, then the variable form.x wont exist when the form is submitted --->
    <cfif isDefined("form.sbmt")>
    <cfset isAppleChosen=0>
    <cfset isOrangeChosen=0>
    <cfset isBananaChosen=0>
    <cfset isGrapeChosen=0>
    <cfif isDefined("form.apples")>
        <cfset isAppleChosen=1>
    </cfif>
    <cfif isDefined("form.oranges")>
        <cfset isOrangeChosen=1>
    </cfif>
    <cfif isDefined("form.bananas")>
        <cfset isBananaChosen=1>
    </cfif>
    <cfif isDefined("form.grapes")>
        <cfset isGrapeChosen=1>
    </cfif>
    <cfquery name="saveInfo" datasource="myDSN">
    insert into fruitChoice (userID,apple,orange,banana,grape)
    values ('#session.userID#',#isAppleChosen#,#isOrangeChosen#,#isBananaChosen#,#isGrapeChosen#)
    </cfquery>
    </cfif>
    And, finally, the form
    <form>
        <p>
        <cfif getinfo.apple EQ 1>
            <input type="Checkbox" name="apples" checked>apples
        <cfelse>
            <input type="Checkbox" name="apples">apples
        </cfif>
        </p>
        <p>
        <cfif getinfo.orange EQ 1>
            <input type="Checkbox" name="oranges" checked>oranges
        <cfelse>
            <input type="Checkbox" name="oranges">oranges
        </cfif>
        </p>
        <p>
        <cfif getinfo.banana EQ 1>
            <input type="Checkbox" name="bananas" checked>bananas
        <cfelse>
            <input type="Checkbox" name="bananas">bananas
        </cfif>
        </p>
        <p>
        <cfif getinfo.grape EQ 1>
            <input type="Checkbox" name="grapes" checked>grapes
        <cfelse>
            <input type="Checkbox" name="grapes">grapes
        </cfif>
        </p>
        <p>
        <input type="submit" name="sbmt" value="send">
        </p>
    </form>

Maybe you are looking for

  • Xstep work instruction in Production Order

    Hi, I am interested in setting up xstep to view documents assigned to FG and component & operations in PI sheet. Could any one reply me how to set xstep to show this? Regards

  • Slow syncing on my iPhone 3GS

    Hi guys I recently got a 3GS, and i'm trying to transfer music to it on iTunes on Windows 7. However, it's so slow! In 1 hour it manages around 100 tracks, and it keeps freezing for shot periods of time. I've tried doing it manually, and i've tried s

  • JSP as Home Page on iPlanet

    Is it possible to configure the iPlanet web server 4.1 to serve a JSP as its           home page from WL when a user hits a URL like http://www.mywebsite.com? The           proxy by jsp extension and directory work fine when the URL is anything      

  • Need help troubleshooting WRT54G internet problem

    Recently in order to reconfigure my linksys router WRT54GL, i had to do a factory reset because of password problems. Then i logged in and set it to PPPoE (as usual), and ever since the internet has been completely erratic. I have this far used only

  • Export-CSV Not working for a user

    Hi Guys, Here's a good one for you. I have a client who is trying to run the script Get-ScheduledTasks.ps1 with the option to export-csv. So he's running .\get-scheduledTask.ps1 | Export-CSV C:\schedtask\schedtask.csv The script runs just fine but do