Keeping text intact in disabled checkbox

hi all,
If I disable a checkbox, I want to keep it's name/text not disabled
(normal) would it be possible?
Thanks

You could probably get into overriding paint methods or creating a new UI delegate for the checkbox, but both of those are going to be fairly daunting. One solution would be to just create a label and place it next to a 'blank' checkbox. Change the foreground color to the same color you would expect the checkbox to use (I did it the sloppy way, I hardcoded it) and your set. If you run this little app you'll notice that the label doesn't quite line up like it would with a real checkbox, but it won't be noticeable as long as you don't have any other checkboxes nearby.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CheckBoxTestFrame extends JFrame
   private JCheckBox _chkDummy;
   private JCheckBox _chkDisablingCheckbox;
   public CheckBoxTestFrame()
      super("Checkbox test frame");
      Container content = getContentPane();
      content.add(getCheckboxComponent(), BorderLayout.NORTH);
      content.add(getButtonPanel(), BorderLayout.SOUTH);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      pack();     
      setVisible(true);
   private Component getCheckboxComponent()
      JPanel panel = new JPanel(new GridBagLayout());
      GridBagConstraints gbc = new GridBagConstraints();
      _chkDisablingCheckbox = new JCheckBox();
      _chkDisablingCheckbox.setMnemonic('n');
      gbc.anchor = gbc.WEST;
      panel.add(_chkDisablingCheckbox, gbc);
      JLabel lblNonDisablingLabel = new JLabel("Non disabling label");
      lblNonDisablingLabel.setForeground(Color.black);
      lblNonDisablingLabel.setLabelFor(_chkDisablingCheckbox);
      lblNonDisablingLabel.setDisplayedMnemonic(_chkDisablingCheckbox.getMnemonic());
      gbc.gridx = 1;
      gbc.weightx = 1.0;
      gbc.weighty = 1.0;
      panel.add(lblNonDisablingLabel, gbc);
      _chkDummy = new JCheckBox("Dummy checkbox for comparison");
      gbc.gridy = 1;
      gbc.gridx = 0;
      gbc.gridwidth = 2;
      gbc.weightx = 0.0;
      gbc.weighty = 0.0;
      panel.add(_chkDummy, gbc);
      return panel;     
   private Component getButtonPanel()
      JPanel panel = new JPanel();
      final JButton btnDisableEnable = new JButton("Disable");
      btnDisableEnable.setMnemonic('a');
      btnDisableEnable.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent e)
            boolean isDisable = btnDisableEnable.getText().startsWith("Dis");
            _chkDisablingCheckbox.setEnabled(!isDisable);
            _chkDummy.setEnabled(!isDisable);
            btnDisableEnable.setText(isDisable ? "Enable" : "Disable");
      panel.add(btnDisableEnable);
      return panel;
   public static void main(String[] args)
      new CheckBoxTestFrame();
}

Similar Messages

  • [CS3 JS] pasteInPlace keeping Text Threads

    Aloha
    I am working on a script the will copy all textFrames on all pages and do a pasteInPlace on a new Layer.
    I have everything working with the pasteInPlace. Other than loosing the Text Threads from overset text.
    Is there a way to have the newly pasted Text Frames do a overflow into the proper Text Frame?
    In my case the overflow Text Frames are on a different page.
    Example:
    Page One has Three Stories. Two of them have overset text. One story is flowed into a Text Frames on Page Two the Second one on page Three.
    Mahalo
    David

    I don't want to move them just make a copy of them.
    I took a look at the layers part from a different direction. I am now just making a copy of say Layer 1 to Layer 2. This keeps everything intact.
    But I am Also looking at doing the same thing but Document to Document.

  • How to script text field based on checkbox selection

    I've written a script to format specific text boxes based on what checkbox is chosen. However, I'm not sure what I need to script in order to CLEAR the text field once the checkbox is unchecked. As it stands now if the checkbox is selected it formats the text field with the necessary information, but if it's unchecked the information stays in the box. I'd like to be something like 'if all boxes are Off then display 0.00.' I've included the current script for reference
    var one = this.getField("Emp 500");
    var two = this.getField ("Emp+C500");
    var three = this.getField("Emp+S500");
    var four = this.getField("Fam500");
    var five = this.getField("NC500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='70.70'}        
    else if (two.value ==
    'Yes') {six.value='127.20'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='198.00'}
    else if (five.value == 'Yes') {six.value='0'}
    var one = this.getField("Emp 1500");
    var two = this.getField ("Emp+C1500");
    var three = this.getField("Emp+S1500");
    var four = this.getField("Fam1500");
    var five = this.getField("NC1500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='61.47'}
    else if (two.value == 'Yes') {six.value='110.49'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='123.04'}
    else if (five.value == 'Yes') {six.value='0.00'}

    Hi Gayathri,
    Gayathri Venugopal wrote:
    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number- Text field
    Order number should be disabled and only on selection of order type ,order number should be enabled.
    Can someone please help me on this?
    Create two dynamic action
    1. Make it order number item disable on page load.
       Event : Page Load
       Action : Disable
       Fire When event result is : True
       Selection Type : Item
       Item : Your order number item
    2 . enable and disable order number on selection of order type(assuming when order type is null it is disable otherwise it is enable)
        Event : Change
        Selection type : item
        Item : your order type item
        condition : is not null
    True Action
        Action : Enable
        Fire When event result is : True
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    False Action
        Action : Disable
        Fire When event result is : False
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    Hope this helps you,
    Regards,
    Jitendra

  • I have all my music on an external hard drive. I just transferred all my files to a new hard drive . How do I sync all my files with my itunes library without losing all my playlists etc and keep everything intact?

    I have all my music on an external hard drive. I just transferred all my files to a new hard drive . How do I sync all my files with my itunes library without losing all my playlists etc and keep everything intact?

    Launch iTunes with the Option key held down, click on Choose Library, and specify it. If the external drive doesn't contain the iTunes database files, create a new library there and import that music.
    If the library contains any rented movies, they won't play on a different computer.
    (109334)

  • I have an old ipod touch and it keeps saying, ipod is disabled. I connected it to itunes and it said, sorry you need to put the passcode in, but it wont let me. And my power button doesnt work.

    I have an old ipod touch and it keeps saying, ipod is disabled. I connected it to itunes and it said, sorry you need to put the passcode in, but it wont let me. And my power button doesnt work.

    iOS: Unable to update or restore

  • How do I add and remove text in a text field with a checkbox?

    How do I add and/or remove text in a text field with a checkbox?
    this is my script in the text box......
    event.value="Hello, this is my narrative. \r\n\nFamily: \r\n\n" + this get.Field("FirstName").value + " " + this.getField("LastName").value + was born on"=this.getField("DOB.value + "\r\n\n + this.getField("drpField").value + "\r\n\n" + this getField("Father").value
    The text box looks like this...
    Hello, this is my narrative.
    FAMILY:
    John Smith was born on 08/02/2000
    Boby Lou
    Jack Smith
    I need to add/or remove the father field (Jack Smith) & r/n/n with a check box.
    Does anyone know how to do this?

    There are multiple errors in your code...
    Use this code instead (adjust the name of the check-box):
    var msg = "Hello, this is my narrative. \r\n\nFamily: \r\n\n" + this get.Field("FirstName").value + " " + this.getField("LastName").value + was born on" + this.getField("DOB.value) + "\r\n\n" + this.getField("drpField").value;
    if (this.getField("FatherCheckBox").value!="Off")
         msg += "\r\n\n" + this getField("Father").value;
    event.value = msg;

  • HOW TO KEEP TEXT AT BOTTOM OF PAGE USING JAVASCRIPT-ANSWERED

    UPDATE 5/12/2006: MORE COMPATIBLE CODE:
    Was using OnRequestEnd.cfm to load copyright info at bottom
    of each page but page size varied and copyright info would appear
    at different points on different pages. Didn't look good. Could not
    use tables to align the text for output reasons. Coded a way using
    CSS and JavaScript to keep text at bottom of each page. Be careful
    with CFFORM, us have to set the attribute 'wMode=transparent' in
    CFFORM so text is above form. Tested in IE and Netscape. Put at end
    of individual templates or inside OnRequestEnd.cfm - Enjoy!
    (css goes in your external css file or between local style
    tags)
    .copyright{background-color:#d8d8d8;color:Black;font-size:10px;font-family:Arial;width:10 0%;text-align:center;}
    body {border-bottom-width:0px;}
    (following goes at end of page or in OnRequestEnd.cfm)
    <span id="x" class="copyright">
    my copyright
    </span>
    <!--- *** KEEPS COPYRIGHT LINE AT ABSOLUTE BOTTOM OF EACH
    PAGE --->
    <script>
    if(document.body.scrollHeight <
    document.body.clientHeight){
    var s = 0;
    document.getElementById('x').style.cssText='position:absolute;bottom:'+s+';';
    else {
    var s = document.body.scrollHeight;
    document.getElementById('x').style.cssText='position:absolute;top:'+s+';';
    </script>

    To change it for a given text frame, the frame must be selected when you execute the menu command.
    AlyMcF1 wrote:
    …how can I apply this to the majority (400+) of my text frames at once?
    To change the setting of existing frames throughout your document, use Edit > Find/Change.
    Choose the Object tab.
    Set the Search: field to Document.
    Set the Type: field to Text Frames.
    If there is a formatting attribute common to all the text frames you want to target and change, click the glass/frame icon next to the Find Object Format field to access the Find Object Format Options dialog and set that common attribute.
    Click the glass/frame icon next to the Change Object Format field to access the Change Object Format Options dialog and set the Align: field to Justify under Basic Attributes > Text Frame General Options > Vertical Justification.
    Step through the Find Next/Change sequence to selectively apply the change, or click the Change All button if you're certain you want all the found frames changed.

  • HT1212 I just bought a new ipod touch from a friend but she didn't reset it and everytime that I try to rest it, it keeps saying "Ipod is disable, connect to Itunes" but I'am connected to Itunes and it also says put in correct passcode?? how do I reset it

    I just bought a new Ipod ios from a friend and she didn't reset it before she gave it to me and when I try to connect it to my laptop it keeps saying "Ipod is disable, connect to itunes"and it says to put in the correct passcode but I don't know what the passcode is and now I can't get ahold of my friend that sold it to me. So my question is: How do I reset the passcode and the Ipod touch so that I can sync it to my laptop and so that I can enjoy my new Ipod Touch?

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        

  • How do I keep text in a converted file??

    I want to convert a PDF file that I received as an email attachement.  Can I convert it without saving it first.  It is the type that will let you save a blank form but not the info typed in and I don't want to retype the entire form.

    When I try to save it only the form is saved not the text that was typed in.  I want to save the info so I don't have to retype it.Bob
    Date: Tue, 10 Jan 2012 14:32:10 -0700
    From: [email protected]
    To: [Removed by moderator]
    Subject: Re: How do I keep text in a converted file?? How do I keep text in a converted file??
        Re: How do I keep text in a converted file??
        created by Dave Stromfeld in Adobe CreatePDF - View the full discussion
    Hi, Bob.Yes, CreatePDF will allow you to save a PDF file as a Word file, so you can then type and add text to that Word file. If you received it as an email attachment, it will be easiest to: 1) save it to your computer's desktop, 2) upload it to the CreatePDF service.Please let us know if you have additional questions or issues.Regards,Dave
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Re: How do I keep text in a converted file??
    To unsubscribe from this thread, please visit the message page at Re: How do I keep text in a converted file??. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe CreatePDF by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Trying to purchase through app store on my iphone 4s, keep getting message AppID disabled, even though I have recovered it and changed it. any ideas? I cant purchase apps.

    trying to purchase through app store on my iphone 4s, keep getting message AppID disabled, even though I have recovered it and changed it. any ideas? I cant purchase apps.

    Contact itunes support

  • FIM Sync service keeps restarting after being disabled

    Hi - We are deploying the SharePoint User Profile Store connector and I have followed all the steps here:
    http://technet.microsoft.com/en-us/library/dn511003(v=ws.10).aspx
    However the FIM Sync service keeps enabling and restarting itself - can't see anything in the event logs except a Evt ID: 2001 - Service was started successfully
    What is starting this service? How can I stop so that it remains in the disabled state?
    Thanks
    J

    Hi,
    Based on your description, my understanding is that you want to disable the FIM Sync service, but FIM Sync service keeps restarting after being disabled.
    I suggest you start the FIM Sync service again and stop it, then disable it.
    You shouldn't need to start those services manually - SharePoint will do everything itself when you start the User Profile Sync service in Central Administration.
    Restarted the User Profile Synchronization Service in Central Administration.(Central Administration -> System Settings -> Manage services on server -> User Profile Synchronization Service.)
    Stop the FIM Sync service and then disable it.
    Here are two links, you can use as a reference:
    http://serverfault.com/questions/147738/not-able-to-start-forefront-identity-manager-service
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact 
    [email protected]

  • Disable checkbox in output report

    hi gurus
    I have display checkbox with tick in front of row in output at simple report program. My query is that I want to do disable checkbox whose are on tick in output screen.
    Please suggest me how can I do ?
    Best Regards.
    Pravin

    hey pravin    tryout this code and each time u select checkbox press f8 .
    REPORT  hide_unhide_box
    selection-SCREEN : begin of block b2 with frame.
      PARAMETERS: chk1 as CHECKBOX MODIF ID M1,
                  chk2 as CHECKBOX MODIF ID M1  DEFAULT 'X'.
    SELECTION-SCREEN:END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
       if  chk1 eq 'X'.
         loop AT SCREEN.
             if screen-group1 = 'M1'.
                screen-invisible = 1.
            endif.
            MODIFY SCREEN.
         ENDLOOP.
        endif.
    If usefull please reward with points .
    thanks and regards
    Anoop Gupta

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • Disable checkbox for some records in a datasource

    Hi,
    I am having a datatable which is binded to a datasource. There is a check box for every record in the list. Check on some records and click the submit button. After that i want the records i have already submitted to be disabled(checkbox disabled) when the page is refreshed. Is there any way to do it. plz help. Thanks in advance

    I would have a table field to store the submitted items, so that when you open the page you can compare with that field and use <html:checkbox disabled="true"....> for the submitted records. I think it will work out. Is this only just for that session?

  • Bug : Datatable with disabled checkboxes

    Hello,
    I was able to implement a datatable with modify, delete links for each row.
    The following code works:
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>But, I added a third column of type boolean, which is displayed as a disabled checkbox.
    The table is displayed properly in the browser. But, when I click on the modify, delete links,
    the corresponding action method (DataScreen.modifyAction() or DataScreen.deleteAction())
    is not called.
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column3_Header" /></f:facet>
         <h:selectboolean_checkbox value="#{DataScreen.column3}" disabled="true" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>I would be glad to know if there is any workaround.
    Thanks,
    Ajay

    I forgot to mention that there is no error message in the log file. The same page is displayed again
    after clicking on the Modify or Delete Link.
    If I remove the third column (disabled checkbox), the modify and delete links work fine.

Maybe you are looking for