Appearance of a Dialog

Hi here is my code
public class AudibleHelpDialog extends JDialog{
public ResourceBundle strings = ResourceBundle.getBundle("DefaultSound");
public String HELP = strings.getString("Help");
public static final String DIALOG_TITLE = "Audible Alert Help";
UIJPanel mainPanel = new UIJPanel();
JTextArea text = new JTextArea();
JButton ok = new JButton();
AudibleHelpDialog(JFrame parentFrame,String str,boolean modal)
super(parentFrame,DIALOG_TITLE,true);
init();
public void init()
setResizable(false);
mainPanel.setLayout(new BorderLayout());
text.setText(HELP);
text.setVisible(true);
text.setSize(20,30);
text.setEnabled(false);
text.setBackground(Color.DARK_GRAY);
text.setLineWrap(true);
ok.setText("OK");
ok.setSize(20,30);
//ok.setPreferredSize(new Dimension(70, UIConstants.UI_BUTTON_HEIGHT));
ok.setMaximumSize(new Dimension(70, UIConstants.UI_BUTTON_HEIGHT));
ok.setMinimumSize(new Dimension(70, UIConstants.UI_BUTTON_HEIGHT));
ok.setPreferredSize(new Dimension(70, UIConstants.UI_BUTTON_HEIGHT));
text.setMaximumSize(new Dimension(200, UIConstants.UI_FIELD_HEIGHT));
text.setMinimumSize(new Dimension(200, UIConstants.UI_FIELD_HEIGHT));
text.setPreferredSize(new Dimension(200, UIConstants.UI_FIELD_HEIGHT));
ok.addActionListener(new java.awt.event.ActionListener()
public void actionPerformed(ActionEvent e)
buttonOk_actionPerformed(e);
mainPanel.add(text,BorderLayout.CENTER);
mainPanel.add(ok,BorderLayout.SOUTH);
this.setContentPane(mainPanel);
//setModal(true);
setTitle(DIALOG_TITLE);
setLocation(200,200);
setSize(250,200);
setVisible(true);
//getContentPane().add(mainPanel);
// getContentPane().add(mainPanel);
}On setting the size of my textarea and button, it is not taking the size specified, but occupies whole window.I am not knowing how to proceed..

your question indicates you've spent no time in the tutorials.
time to start
[http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]
click the link for BorderLayout - the answer is there

Similar Messages

  • Does not print web page - 'save as' menu appears - unknown problem dialog box then appears. Only recently - does not happen in explorer??

    Try to print a webpage or selection therefrom.
    When 'file'- 'print' selected on Mozilla tabs, it does not work. The print menu appears but when 'print' clicked, the 'save as' menu box appears. When 'save as' is closed a dialog box appears saying 'unknown error while printing'. Cannot print webpage unless from a screensaver (ie whole screen). This has only happened recently (update maybe). Tried on Windows Explorer and all ok

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • How to send a mail that appears as meeting dialog in MS outlook?

    Hi:
    Is it possible for the mail adapter to send a mail that appears as a meeting dialog in Ms outlook? If yes, could you please tell how to do it? Actually I'm developing my own module. Thanks a lot.

    if writing a module does not help you...I would suggest you go for a Java proxy for sending this mail and refer to this link for creating a Outlook meeting request using Javamail.
    http://www.bloggingaboutoracle.org/archives/java-outlook-integration-sending-a-meeting-request-from-java

  • Brief appearance of a dialog box onscreen

    New 27" iMac w/fusion drive has a dialog box appear briefly, too quick to read. Pops up every once in a while. Flashes onscreen then dissapears.
    Any takers?

    One way to test is to Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, Test for problem in Safe Mode...
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive
    Reboot, test again.
    If it only does it in Regular Boot, then it could be some hardware problem like Video card, (Quartz is turned off in Safe Mode), or Airport, or some USB or Firewire device, or 3rd party add-on, Check System Preferences>Accounts (Users & Groups in later OSX versions)>Login Items window to see if it or something relevant is listed.
    Check the System Preferences>Other Row, for 3rd party Pref Panes.
    Also look in these if they exist, some are invisible...
    /private/var/run/StartupItems
    /Library/StartupItems
    /System/Library/StartupItems
    /System/Library/LaunchDaemons
    /Library/LaunchDaemons

  • If the "unresponsive script" dialog box appears while another dialog box (e.g. a "Save As" box), the two dialog boxes lock each other out

    FF 7.0.1 on MacOSX 10.6.8 (not this machine!)
    While doing a "Save As", and while the "Save As" dialog box is showing, a second dialog box "unresponsive script" shows up. I can't deal with the "unresponsive script" box as it doesn't have focus, and I can't complete the "Save As" operation because its script has become unresponsive. I end up having to Force-Quit Firefox via the Activity Monitor.
    Any less brutal suggestions?

    figured it out:
    - power off mac and turn back on while holding down Command + R (dont do it on an external keyboard just to be safe)
    - choose the re-install Lion option (I'm sure there is another way to re-install Lion, this is just the way I did it, not saying its the best or only method)
    - DO NOT INSTALL MACBOOK (Mid 2012) Software Update 1.0 - THIS SCREWS ADOBE UP!

  • Files not appearing in browsing dialog

    I am using a PVII extension (Image Gallery) that brings up a dialog for selecting files. This worked fine with DW CS4 on XP. However, now that I'm on Windows 7 all I get for any selected directory is "No files found".
    The PVII support folks directed me to an Adobe extension called "Dreamweaver browseForFolderURL" which seems to be intended for this situation. However, after installing and enabling it, still no luck.
    Any suggestions for where to go from here? I really wanted to use that extension to put up a page of photos. I'd also hate to have to spend the $$$ to update to a later DW version just for this.

    See if this helps -
    http://forums.adobe.com/thread/158251?decorator=print&displayFullThread=true

  • Save PDF File As dialog box not appearing

    I am running Acrobat 8 Pro on Windows Server 2008. I'm having a problem with the Adobe PDF printer. When I attempt to print a document to this printer, the "Save PDF File As" dialog box does not appear. The dialog box does open, but it is either hidden behind the running application or is minimized. I have to click the icon on the taskbar to bring the window to focus. This problem only occurs the first time I attempt to print after logging onto the computer. On subsequent print jobs the dialog box shows up fine.

    Is there a registry setting or anything that I can set to get rid of the 'Save Scanned File As' box.
    No.

  • Using Message Built-In - Message dialog box appears twice

    Hi all,
    I'm using the message built-in to display messages in forms.
    I use the message command twice to make it appear as a dialog box.(Using it once displays it in status bar)
    Eg.
    Message('Hello World');
    Message('Hello World');
    Sometimes, the dialog box appears twice instead of once.
    Is there a way to solve this ?
    Regards,
    Sam

    With an alert, you can write up to 200 characters in the alert box. With a message, you can write up to 255 characters, and if you want the message to pop up in an alert box, you can write a double message. I use:
    Message('Hello World');
    Message(' ',no_acknowledge);

  • Modeless Dialog Box Not Displaying Contents

    I have created a simple modeless dialog box. Although the dialog box and title appear, the contents (a label) do not appear. The dialog box does display correctly if the dialog box is switched to a modal box.
    I got into this problem because I also cannot get labels to change after their initial display on the main frame. I've tried repaint() and Thread.sleep().
    Please help me, I am a newbie to Java.
    Sincerely,
    John

    I actually had a similar problem with a JDialog containing only a progress bar, which ended up being a problem with Swing rather than my code (the bug report has already been filed). Adding a second component to the dialog fixed the problem, counterintuitive as that seems. Try it and see if that helps... If the label is a JLabel, you might try calling revalidate() on it to get the text to update.
    Ian

  • File Open Dialog Box  on Button Click

    Hi
    I am devloping some webpages using JSF and RichFaces..
    I would like to appear File open Dialog box to choose single file and multiple files and another Folder chooser dialog box to choose the folder content..
    Both the operation should be performed while choosing the Button Choose File and Choose Folder...
    I have already tried Input type = file and aphace tomohawk..
    But i all the components are coming with text box and browse button..
    I dont need that. I need to open the dialog box once i clilck my choose file r folder button and it should work browser indepent.....

    HTML doesn't provide you the possibility to select multiple files or select folders at a single browse. Thus JSF can't do any much for you. Best what you can do is to write a signed applet or web start application which does the task. The Mojarra Scales component library has a ready-to-use component which embeds an applet which does that task. Check [https://scales.dev.java.net/multiFileUpload.html].

  • Empty PopUp Dialog box while uploading a document in document library

    Hi ,
      I  want to upload a document to shared document folder .While adding new document to this library it opens browse dialog and then  after i selected some specific document  then select "ok" then after it appears an empty dialog
    which does not contains any thing except close and maximize button at the top corner.
    It appears in all sites/site collection through out the  web application
     Can any one help me ....
    thanks in advance ...
    Nag 

    hi
    Try uploading a single file of small size.
    Please let me know the outcome
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Photoshop CS3 Save and Save As Dialog box not working

    I can't do a "save as" or "save for web" in photoshop cs3. The dialog box opens and I can't change anything but the file type pull down menu (and sometimes not even that). This problem happens sporadically.... but most of the time it doesn't work.
    I have re-installed Photoshop cs3 but I still have the same problem.
    Photoshop CS3 10.0.1
    MacPro 2 x 3 GHz Quad-Core Intel Xeon
    Memory : 4GB
    Mac OS 10.5.8
    Please Help

    I'm seeing exactly this same problem with Photoshop CS3  after the upgrade to 10.5.8. It appears that the dialog box never gets focus for "Save for Web and Devices" -- the title bar of the dialog is grayed out, while the main "Save for Web and Devices" panel still has focus.  That means there's no way to clear the dialog, since the panel is waiting for it to return, but the dialog can't get any input.  None of the standard resets work for any length of time.  I seem to remember similar problems in a much earlier release of Mac OS X, but I can't be sure.  Quite annoying.

  • Question on using dialog functions

    When I use some dialog function, such as two button dialog box, can I change some properties, such as the size of popup widow, font size and color?
    I just want to make some more friendly and professional interface of my application to users.
    Thanks.  
    -Dejun

    That means you have to program your own pop-up vi. Some major steps to
    get there is by changing the file>vi properties>window appearance
    settings to "dialog."
    Also use the dialog controls that are system specific (they have their
    own menu in the controls palette). Also implement some cool things such
    as cancelling the vi when pressing "escape" or clicking "window close."

  • Labview runs in front of dialog box from third party .exe - cannot simulate keyboard input

    Hello,
    I need to use an external software to set some parameters of an actuator. When I run this software from Labview (using System Exec.VI) it opens a screen while loading and then a dialog box. I need to select something from this dialog box (I am using a keyboard simulator). But just after the dialog box appears, Labview's window comes in front of it and then all the keyboard commands end up in the Labview's window instead of the external dialog box.
    Has anyone ever had a similar problem? I have been looking aroung and I could not find a solution. I cannot use the ALT+TAB or anything like that because dialog boxes do not appear there (something of "modal" and "non-modal" windows).
    I came up with a very unreliable solution by chance: If I hit (actually simulate) one key while the loading screen is on and before the dialog box appears, then the dialog box stays upfront. I think it is like telling the Labview "do not come to the front, I want to stay working in this other window". I do not trust this temporary solution at all but maybe it triggers an idea for a solution.
    Please see the attached image: After I hit the RUN button, my exe is called and the "loading" screen is displayed on front. Then, the dialog box is left behind the Labview interface.
    Any ideas are welcome!!
    Thanks,
    Laura

    Hi Wayne,
    I believe it is a good idea to use Portmon, I will give it a try hopefully today. 
    I have attached the two manuals that can be downloaded from the actuator's webpage (http://www.miraiintertech.com). Then I have attached the manual of the software (I cannot attached the software because they sell it); check on page 24: CTA-1EX, that's the software I am using. 
    Isn't it weird that there is little info about the dialog box thing? I would have thought that many people had this issue.
    Thanks for the help! 
    Laura
    Attachments:
    EE06426I.pdf ‏1094 KB
    TMBSCOM.pdf ‏319 KB
    TBVST-Manual2009.pdf ‏4482 KB

  • Focus Problem -- Two Non Modal Dialogs

    Hi ,
    In my applet, when user does something which is not allowed, I display an error message box (JOptionPane dialog - modal).
    There is another dialog box (non modal) that user
    can open to view search results and put it aside the
    applet window to do some parallel work.
    Now when error message dialog appears, the search
    dialog box also pops up even if the user
    has put this behind the applet window (by clicking browser window or applet, the search dialog goes behind the window).
    Can you please let me know, how can I get rid
    of this search dialog (non-modal) popup. I mean
    search dialog should remain open but should not
    come infront (ie should not get focus) when modal
    error message dialog pops up.
    NOTE: I don't want to make search dialog
    a modal dialog.
    Thanx,
    [email protected]

    Thanks for the reply michael. I forgot to mention particularly during my post that i am facing this problem on Solaris system. Running the same application on windows is working fine. I can't make other non-modal dialogs visibility to false because they should be visible on the screen all the time throught out the application life cycle and making it visible/non-visible doesn't get sense in my application. Does anybody is facing the same problem with Solaris system? Plz help.
    Hitesh

Maybe you are looking for