Can we rename default 'ok' button in a dialog box??

In dialog box generated below,I don't want the default ok button displayed,is it possible to remove it??or is there any way to rename it and change its position by using a layout manager??
import javax.swing.*;
public class DialogBoxDemo
public static void main(String args[])
    JPanel panel=new JPanel();
    JPanel leftBox=new JPanel();   // left panel with a box layout
    leftBox.setLayout(new BoxLayout(leftBox,BoxLayout.Y_AXIS));
    JTextField textfield = new JTextField(10);
    leftBox.add(textfield);
    JTextField textfield1 = new JTextField(10);
    leftBox.add(textfield1);
    JCheckBox cb = new JCheckBox();
    leftBox.add(cb);
    JPanel rightBox=new JPanel();  // right panel with a box layout
    rightBox.setLayout(new BoxLayout(rightBox,BoxLayout.Y_AXIS));
    JButton but1=new JButton("Find Next");
    JButton but2=new JButton("Cancel");
    rightBox.add(but1);
    rightBox.add(but2);
    panel.add(leftBox);
    panel.add(rightBox);
    JOptionPane.showMessageDialog(null,panel,"Replace",JOptionPane.INFORMATION_MESSAGE);
}It is possible to use default ok button instead of creating a cancel button,but I don't want a button there.I want a button in the rightBox panel which is set in a Box Layout...
Thanks in advance...

To rename buttons, try:
    UIManager.put("OptionPane.cancelButtonText", "Your text");
    UIManager.put("OptionPane.noButtonText", "Your text");
    UIManager.put("OptionPane.okButtonText", "Your text");
    UIManager.put("OptionPane.yesButtonText", "Your text");You can rename ok button to...for instance "cancel", but in fact, this will not change its value...Your new cancel button will be JOptionPane.OK_OPTION
sorry it's quite late to reply for this, but other googling people might find this topic with exact problem or a little similar.

Similar Messages

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • Pointer does not move to the default button in the dialog box

    example: when cleaning out trash the pointer does not go to the default button in the dialog box, you have to manually go there.
    This happens all the time.

    Hi Abhishek,
    In SAP this job shows completed till the 3rd step. and no error in the job log. but it does not execute the 4th and the 5th steps. And in Redwood, it shows completed for 1st and 2nd steps, 3rd step is in Error but has no error log. The 4th and 5th steps are in chained status. I have not amended the job chain after import. I have just scheduled it as it was running in the SAP system.
    Let me know if you need some further information on this.
    Regards
    madhu

  • Upgrade to Acrobat Pro XI on Window 8.1 downloads, installs and configures. Then pressing the launch button in the dialog box doesn't launch program.

    Upgrade to Acrobat Pro XI on Window 8.1 downloads, installs and configures. Then pressing the launch button in the dialog box doesn't launch program.

    Using the start button, Acrobat Pro should appear. But it might not, being Windows 8. Maybe it puts an icon on your desktop, maybe not.
    How about checking c:\program files (X86)\adobe\acrobat 11.0\acrobat. If you have this folder, look for Acrobat.exe.

  • Grouping Radio Buttons on a Dialog Box

    Hi,
    Sorry to post this, I could not get any doc that could help.
    I have three groups of  radio buttons in a dialog box and, I set the Group property of each of the first radio button in a group to true. But it does not seem to work. Did I miss something?
    Thanks for your help.

    Found the solution:
    I Used 'ADMRadioGroupSuite1' Suite - RadioGroupSuite ("ADM Radio Group Suite") to group them. 

  • Can we rename the Apply button to RUN or GO in BI Publisher 11g?

    Hi ,
    We have a requirement to rename the Apply button to RUN or GO. ( after selecting the parameters , we have to click the Apply button)
    Can this be achieved?
    Thanks
    Ashish

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • Can I change the Default Position of a JColorChooser Dialog Box???

    I am working on a drawing application where I am using a button that launches a JColorChooser dialog to allow a user to select a color which. I have tied this button to the JColorChooser using the source code below to reset the color based on the user's selection. This all works fine. However, when the JColorChooser comes up, the dialog comes up right in the middle of the drawing area and erases any portion of the drawing that the dialog box overlaps with, which having my luck is more or less right in the middle of the JPanel where I am doing the drawing. My question is can I tell the JColorChooser to come up somewhere else in the user interface by offsetting it from the actual application somehow? I am using a JFrame to add all of these components to (the color choose button and the drawing area) and wonder if there is a way to tell the JColorChooser dialog not to come in the default location. Any help that anybody could provide would be greatly appreciated. Thanks!
    Kevin
    pickColor = new JButton( "Choose Color" );
    pickColor.addActionListener(
    new ActionListener() {
    public void actionPerformed(ActionEvent event)
    color = JColorChooser.showDialog(
    ColorPicker.this, "Choose a color", color);
    if ( color == null )
    currentColor = Color.RED;
    else
    currentColor = color;
    );

    JColorChooser has a method createDialog() that lets you create (rather than
    merely show) a dialog containing your colour chooser.
    If you use this method you can position the dialog wherever you want. The
    dialog inherits the Window methods for positioning - eg
    setLocationRelativeTo(Component c).

  • Can't change default user name on Authentication dialogs

    Due to a corrupt user account, I had to create a new user account. I specified a "2" at the end of my full name i.e. "Full Name 2" because I couldn't use the same full name as the corrupt account.
    I still haven't deleted the old corrupt one yet just in case I need something, however, now that I am using the new account I renamed the new account to "Full Name" without the "2" at the end of it, but for some strange reason OS X still uses "Full Name 2" on the authentication dialog boxes.
    Just to summarise, I do not have an account called "Full Name 2" anymore - I've even updated the contact record - and when I get asked to authenticate via a dialog box, the name defaults to "Full Name 2".
    Not sure why it's still doing this and how do I get rid of it - I just it to default to "Full Name".
    At the moment I can login with both "Full Name" and "Full Name 2".
    I tried deleting some preferences and re-log back in - but this didn't do the trick, but admittedly I may not have trashed the right ones.
    Please help.
    Thanks.

    First, I create a new user account via System Preferences -> Accounts. I gave it a different account name and I entered the same full name. It rejected it saying the full name was already in use, so I renamed the full name to "Full Name 2" just to I can create the account.
    Then, I logged in to the new account. Tested it, set it up how I wanted it.
    Then I logged back in to the old faulty account, and renamed the full name from "Full Name" to "Full Name OLD". I did this via Accounts. I simply double clicked the old account and the edit window showed up. I just renamed the full name field.
    I then edited the new account, and renamed the full name field from "Full Name 2" to "Full Name". Since the original account now had a different name, I was now able to rename the new account to the desired name, i.e. without a "2" in it.
    However - now it shows a 2 in the default account name whenever I need to authenticate something.

  • Is there a way to change the defaulted (press 'Enter or Return on keyboard) button in a dialog box? Specifically,

    When the cookie preference is set to "ask every time" the default button (highlighted & selected when I hit return or enter) is "allow." Can I change the default button to "allow for session" so I don't have to use the mouse to select it?

    Your question/suggestion got me thinking about making a programmable function key (PFK), but I couldn't think how to make a PFK represent a mouse click. Then I tried the option [ ⌥ ] key (I don't have Alt [⎇ ] ) and the s, with or without the shift. I tried the command [⌘] key, and finally the control [⌃] key with the s — that's the one that worked. 8¬D
    I remembered scripting radio buttons, which might apply here, but it's been too long ago.
    Thank you for pointing me in a new direction, that will do well enough 'till I find out if the default button(s) can be changed in dialog boxes in general.

  • Pages button  in printer dialog box  is deactivating while taking print ?

    Hello exports,
    while taking print abap reports (developed using smartforms) pages buttoon (from- to) in printer dialog box
    is by default is deactivating .How to activate this button ? who will do this one (Abaper or basis guy).
    pls help me in this.

    Hi,
    So, as you see a field "from ... to ...", I think you are talking about the "background print parameters" dialog (this is not the smart forms print dialog, which contains field "page selection").
    I don't understand. "Pages from ... to ..." is always displayed, and the user can enter them manually. Do you want to enter pages programmatically?
    What is your code or the steps to display this dialog? Is it fully standard or do you use GET_PRINT_PARAMETERS programmatically?
    Sandra

  • FPM : how to subscribe buttons event for Dialog box

    Hi All,
    I am calling a FPM configuration as popup, i have used standard button CLOSE. Now I wanted to assigned my own action to it. How can i achieve this ?
    As in webdynpro we can use  SUBSCRIBE_TO_BUTTON_EVENT, similarly which method i can use in FPM ?
    E.g. in below case i wanted to write my own code on click of OK button.
            LS_DB_PROP-BUTTON_SET = 2.
             LS_DB_PROP-TEXT_FOR_CLOSE_BUTTON = 'Ok'.
             CALL METHOD LO_FPM->OPEN_DIALOG_BOX
               EXPORTING
                 IV_DIALOG_BOX_ID         = LV_WINDOW_ID
                 IS_DIALOG_BOX_PROPERTIES = LS_DB_PROP
                 IO_EVENT_DATA            = LO_FPM_EVENT_DATA
    *           IV_EVENT_ADAPTS_CONTEXT  =
    Thanks in Advance,
    P$G

    Hi Prathamesh,
    Refer to this Opening and Closing FPM Dialog Boxes which might help you.
    For catching the event :
    When cl_fpm_event=>gc_event_close_dialog_box.
           io_event->mo_event_data->get_value(
             EXPORTING
               iv_key   = 'DIALOG_BUTTON_ACTION'
             IMPORTING
               ev_value = lv_string
           IF lv_string EQ 'CLOSE'.
    Write logic here
         endif.
    Hope it might help you.
    Thanks
    KH

  • Set thumbnail view as default in the File open dialog box

    When I hit File/Open in PS, the dialog box always opens in"details" and I have to hit the select view icon and chose "thumbnails". I've looked in preferences but can't find anything to change the default to Thumbnails. Is it that you have to do this somewhere in Windows OS ?

    What versions of Photoshop and Windows are you running?
    I ask, because running Photoshop CS5 and Windows 7 x64 when I select a view - e.g., Large Icons (which yields thumbnails) it sticks.  Make sure you actually open a file after making the change.
    -Noel

  • Handling button events for dialog boxes of a used component

    Hello,
    After I call a dialog box/window for the view of the used component, how can I handle the button events of the window that I called?
    I create the window using the method CREATE_WINDOW_FOR_CMP_USAGE of the interface IF_WD_WINDOW_MANAGER. This method returns window reference of type IF_WD_WINDOW.
    Thanks & Regards,
    Reena

    It's very easy.
    Have a look to the document: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9e242bf5-0901-0010-c99c-83c180163c73
    You will find the SUBSCRIBE_TO_BUTTON_EVENT on page 6.
    Sergio

  • Tooltip for buttons on Confirmation Dialog Box

    Hi,
    How can we set the tooltips for buttons on the Confirmation Dialog Box.
    Pls throw some light on it.
    Rgds
    Shashank

    Found the solution:
    I Used 'ADMRadioGroupSuite1' Suite - RadioGroupSuite ("ADM Radio Group Suite") to group them. 

  • Clicking a button in a dialog box, Pro Tools

    I am new to Applescript and would like some guidance. I tried to make this work with Quickeys but didn't get very far. I am using a plug-in called Source Connect, which allows realtime recording sessions via the Internet. I'd like Source Connect to automatically respond when an incoming session request is received. A popup dialog box appears asking YES or NO, and I'd like it to click YES.
    Am I asking too much of Applescript, or is this possible?
    George Whittam

    yayathi wrote:
    1. add ActionListener to the button
    2. in the actionPerformed(), hide the current JFrame
    3. create new JFrame and show (setVisible(ftrue);)
    this is correct, but make it little more clear 4 you subbu.
    1 add ActionListener to the button in frame ONE.
    2 inside its actionPerformed() create object of SECOND frame and call setVisible(true) on SECOND frame. or can
    do it inside the constructor of frame SECOND.
    3 then call dispose() or setVisible(false) on frame ONE.
    cheers :)

Maybe you are looking for

  • Problem with rds on exadata

    Hi, I have a problem with rds on exadata. After upgrading to uek kernel and patching to cell 11.2.3.3.0, I get following error: Aug 18 16:17:36 exadb01 kernel: RDS/tcp: send to 192.168.10.5 returned -32, disconnecting and reconnecting Aug 18 16:17:36

  • FILEIO message sequence counter reset after domain restart

    Hi, I have configured FileIO to pick message from RIB-RMS topic and create xml message. It is working fine. These xml message are pick by external system based on their sequence number in file name itself. like File name 'Items_ItemCre_100069945.775'

  • At the time of doing subsequient credit in Transaction code MIRO

    Hi SAPians i have a querry At the time of doing subsequient credit in Transaction code MIRO what are the accounting entries generated and especially i would like to know what transaction keys will come into the picture.

  • Screen is asking for a 4 digit passcode. what is it  ? i never saw it before

    today my i phone display asking for a 4 digit passcode. i never had seen this before and had no passcode.  i can't use my phone

  • Displaying metadata, how to display ONLY the Date

    I would like to display the Date below each image in Aperture 3. When I select "Date" in the Browser & Viewer Metadata window, the result is a very long string with the Date, the Time and the Time Zone. meaning that most of the time I see nothing bec