Non Resizable JDialog with icon

Hi All...
How to create dialog with icon on the top left corner and also this dialog should be non resizable.
Thanks
sanjay

Use setResizable(false) to make the dialog non-resizable.
The Dialog automatically inherits the icon of the parent Frame/Dialog which is passed in the constructor.

Similar Messages

  • Can I resize undecorated JDialog with mouse?

    Hi all,
    I use a undecorated JDialog as a message panel in my application, but I can't resize it with my mouse. Can this be achieved?

    It's not like Photoshop resizing at all - Flash is a vector
    engine, not a
    bitmap engine. Depending on the image and how much you are
    scaling it, it
    can look OK scaled, but it'll never be as good as in Pshop.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Problem with Icons

    Hi!
    I'm trying to make a chess game, and I'm having the following problem.
    I have a JLayeredPane that contains a JPanel with other 64 JPanels inside. The pieces are JLabels with Icons.
    The problem is that when I begin a new game, the chessboard appears empty, with no pieces whatsoever, even though those labels are in place.
    If I try to resize just for a bit the main frame, the pieces appear on their positions just like they should in the first place.
    I've tried everything, but they just refuse to appear until I resize the frame (I should add that the chessboard is big enough for the icons to fit, so it is not this .... ).
    Can anyone help?

    So here goes:
    I have an intro frame that has a new game button. When the Button is pressed, I create the main frame, I put in the JlayeredPane and all the other panels and pop up a JDialog message, in which I request certain info. This dialog has an OK button, which should add the labels (with the icons) to the panels on the chessboard.
    I don't think the layout creates this problem, because I've seen it working with exactly the same stucture. The only difference I could see was the dialog box. So I'm guessing this dialog is creating the problem.
    PS: I don't have the code here, I'll get back with that later on.....

  • Have just installed Mavericks and restarted the MacBook Pro. That was 3 hours ago and after logging in, I got my wallpaper and dock, but none of my desktop icons, just the spinning coloured wheel. It's been like that for 2 hours. Is this normal? What shou

    Have just installed Mavericks and restarted the MacBook Pro. That was 3 hours ago and after logging in, I got my wallpaper and dock, but none of my desktop icons, just the spinning coloured wheel. It's been like that for 2 hours. Is this normal? What should I do, please?
    I tried holding the on/off switch down to make it shut down, but when I turned it back on again, the same thing happened and none of the keys etc makes any difference.
    HELP!!!! Please.

    No, what you're experiencing is not normal.
    Try booting whilst holding down the Shift key - this will allow you to boot into Safe Mode, disabling third-party kernel extensions, etc. Your Mac will be slow to boot and will operate sluggishly. That's normal. If you can get in using Safe Mode then you have some start-up item that doesn't play well with Mavericks.
    Call back,
    Clinton

  • Since installing firefox, none of my dscktop icons for web page short cuts work. Why?

    None of my desktop icon short cuts for web pages work since I installed firefox.
    Why?
    Can you help me with this?

    You can check for issues with the Windows icon cache and try to rebuild the icon cache.
    # Open the Task Manager (Shift+Ctrl+ESC)
    # In the Process tab, right-click on the Explorer.exe process and select End Process.
    # Open the file picker via "File > New Task (Run)" and click the Browse button.
    # Type or Paste %USERPROFILE%\AppData\Local (%LocalAppData%) in the File name field (AppData is a hidden folder).
    # Select the IconCache.db file and use "Delete" in the right-click context menu to delete the file.
    # After the IconCache.db file has been deleted, start a new explorer.exe process via "File > New Task" to get the desktop and Taskbar back.
    The IconCache.db file is a hidden file, so make sure that you can see hidden files.
    * http://kb.mozillazine.org/Show_hidden_files_and_folders

  • How can I prevent the text in non-resizable contexts from being cut off?

    I have not changed the Application, System, or Dialog fonts from their defaults.  
    This is the result:
    Related:  http://forums.ni.com/t5/LabVIEW/text-in-non-resizable-windows-is-cut-off/td-p/92300

    Medium might be the default for high ppi monitors but it is very different from the original windows settings that were used when 96 ppi was standard. Of course for a high resolution FullHD resolution on a 15 inch screen you end up with a ppi of around 150ppi.
    This article explains somewhat the history of where 96ppi came from and that it was in fact already a convinient misrepresentation of the real values. The problem is partly that LabVIEW makes some assumptions about the size of text based on the actual ppi settings while the rendering of the text as done by Windows can be scaled by your control panel adjustment. However the solution is not as trivial as replacing all assumbtions about the size of text by the new values as that won't always give the correct values either and also has quite a lot of other issues such as controls suddenly looking very oversized when moving a front panel from a low ppi device to a high ppi device. Basically the way Windows deals with screen resolution and different ppi makes it simple for Windows to render text on a display without ugly aliasing effects but makes it impossible for an application to both be text and size accurate when rendering windows like a LabVIEW front panel.
     It's also a reason why so called retina displays still don't really work under Windows while IOS has them already for quite some time.
    Ravens Fan, Windows 7 has Normal (100%), Medium (125%) and Larger (150%). To maintain the relative text size on an old CRT for a FullHD 15 inch labtop display one would have to use the Larger setting, which is outright ugly. I personally use Smaller on all my Windows 7 labtops because of issues like the LabVIEW front panels rendering but also many other applications get into trouble otherwise. Yes it looks kind of small on my FullHD 15 inch LCD monitor, but at least it is all consistent.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Is there a way to display a  non modal JDialog on JApplet

    Whenever I try to add a non modal JDialog over a JApplet, the JDialog freezes and components on it never gets painted. After a disappointing search over web, I've kinda begin to hate swing. I am shocked that a very basic thing like this is so hard to achieve in Java. Any solution folks?
    My code is as follows:
    import java.awt.Frame;
    import javax.swing.JApplet;
    import javax.swing.JDialog;
    import javax.swing.JLabel;
    import javax.swing.JButton;
    public class DialogApplet extends JApplet {
         private javax.swing.JPanel jContentPane = null;
         private JButton jButton = null;
          * This method initializes jButton     
          * @return javax.swing.JButton     
         private JButton getJButton() {
              if (jButton == null) {
                   try {
                        jButton = new JButton();
                        jButton.setText("Click Me"); 
                        jButton.setBounds(75, 80, 147, 34); 
                        jButton.addActionListener(new java.awt.event.ActionListener() {
                             public void actionPerformed(java.awt.event.ActionEvent e) {   
                                  Frame f = javax.swing.JOptionPane.getFrameForComponent(jContentPane);
                                  JDialog pi = new JDialog(f, "MainFrame Dialog", false);
                                pi.getContentPane().add(new JLabel("I got to be working Bossie!!!"));
                                pi.pack();
                                pi.setLocation(75, 80);
                                pi.setVisible(true);
                                try {
                                Thread.sleep(10000);
                            } catch (InterruptedException e1) {
                                e1.printStackTrace();
                                pi.setVisible(false);
                   catch (java.lang.Throwable e) {
                        e.printStackTrace();
              return jButton;
         public static void main(String[] args) {
          * This is the default constructor
         public DialogApplet() {
              super();
              init();
          * This method initializes this
          * @return void
         public void init() {
              this.setSize(300,200);
              this.setContentPane(getJContentPane());
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private javax.swing.JPanel getJContentPane() {
              if(jContentPane == null) {
                   jContentPane = new javax.swing.JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.add(getJButton(), null); 
              return jContentPane;
    }

    try this, it is really simple, just to look at
    example from the swing tutorials.
    Thanks my friend, If you carefully observe my code, I also needed some piece of code to run in the background ((The thread.sleep() part)) while displaying the dialog. The problem was the JDialog used to freeze and components on it never used to get painted. Finally I managed to find a way out. If we try to display a JDialog with a new thread, The event dispatching thread takes precedence and the painting of components on the JDialog happens only after even dispatching thread is done. All I did was display JDialog in the event dispatch thread and run the background process in new thread.
    My code.
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.Frame;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    public class DialogApplet extends JApplet {
        private javax.swing.JPanel jContentPane = null;
        private JButton jButton = null;
        private JDialog dialog = null;
         * This is the default constructor
        public DialogApplet() {
            super();
            init();
         * This method initializes this
        public void init() {
            this.setSize(300, 200);
            Container container = this.getContentPane();
            container.add(getJContentPane());
         * This method initializes jContentPane
         * @return javax.swing.JPanel
        private javax.swing.JPanel getJContentPane() {
            if (jContentPane == null) {
                jContentPane = new javax.swing.JPanel();
                jContentPane.setLayout(null);
                jContentPane.add(getJButton(), null);
            return jContentPane;
         * This method initializes jButton
         * @return javax.swing.JButton
        private JButton getJButton() {
            if (jButton == null) {
                try {
                    jButton = new JButton();
                    jButton.setText("Click Me");
                    jButton.setBounds(75, 80, 147, 34);
                    jButton.addActionListener(new java.awt.event.ActionListener() {
                            public void actionPerformed(java.awt.event.ActionEvent e) {
                                showDialog();
                } catch (java.lang.Throwable e) {
                    e.printStackTrace();
            return jButton;
         * This method displays Dialog
        public void showDialog() {
            final Frame frame = JOptionPane.getFrameForComponent(this);
            dialog = new JDialog(frame, "DialogApplet", false);
            dialog.setModal(true);
            Container contentPane = dialog.getContentPane();
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(new JLabel("I got to be working Bossie!!!"), BorderLayout.CENTER);
            contentPane.add(panel);
            dialog.pack();
            Thread t = new Thread() {
                    public void run() {
                        for (int i = 0; i < 100000; ++i) {
                            System.out.println(i);
                        dialog.hide();
            t.start();
            dialog.show();
    }

  • Is there a wrist watch that will sync up with Icon?

    is there a wrist watch that will sync up with Icon?

    None at the moment.  There are strong hopes for Pebble, Pebble Smartwatch | Smartwatch for iPhone & Android.
    Microsoft is rumored to release/announce a device sometime in October.

  • Error: there are non exicisable item with cenvat tax code

    I am getting an error message there are non exicisable item with cenvat tax code while trying to add po for pick and pack from sales order. I request all of you to help me with it.
    I have already checked if the item and ware house is exicisable in the check box of the master data.
    Best regards,
    Sandesh.Sreyamsh

    Thanks mahendra and rahul,
    Unfortunately my issue is not solved yet, the tax is not manually created it was created by sap during new company creation. I checked by adding other tax type in sales order but every time when I try to create sales bom it gives the above error.
    @ Rahul the tax is under cenvat type and the Items has been added under exercise transaction. here is what im trying to do
    I created a sales order for 4 of my items.
    Then i try to create po for two of my as pick and pack items by checking Purchase orders indicator under logistics tab of sales order.
    At this point i am getting the above said error.
    All the items i am trying to add is exisable and tax is also of cenvat type.
    Please help me out of this as im stuch very badly in this issue.
    Regards,
    Sandesh.Sreyamsh

  • Help needed in Drag and Drop and  resizing of image icons

    Hi all,
    I'm doing a project on Drag and Drop and resizing of image icons.
    There is one DragContainer in which i have loaded the image icons and i want to drop these image icons on to the DropContainer.
    After Dropping these icons on to the DropContainer i need to resize them.
    I have used the Rectangle object in resizing.
    The problem now i'm facing is when i drag, drop and resize an image icon and when i try to drag, drop a second image icon the first image icon gets erased.
    can any one help me in fixing this error.
    if u want i can provide the source code.
    thanks in advance
    murali

    the major restrictions in its implemented only in
    jdk1.1.Why!

  • Can i use a non-apple keyboard with my imac?

    can i use a non-apple keyboard with my imac?

    Welcome to the Apple Support Communities
    You can use the keyboard you want with your iMac. However, note that some keys, as the Command key, aren't present in non-Apple keyboards. For example, in a non-Apple keyboard, you have to press the Windows key because that's the replacement of the Command key of an Apple keyboard

  • ALV GRID with icon fields. When exports to Excel, icon fields are emtpy.

    Hi all,
    In our SAP system (6.0 ECC) we've noticed the following behaviour:
    In ALV GRID with icons (color lights for example...) when we export the list to Excel format with the standard button bat, the icon column is always empty.
    We think that in previous SAP version (4.7), the code corresponding to the icon appeared (For example @08@ for green light).
    It's possible to have tha same functionality in this new version like in 4.7?
    Regards.
    Edited by: Ole ES on Nov 17, 2010 6:05 PM

    Hi,
    Check the format in which you export to Excel (MHTML, XML, ...) and try antoher one.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/66/79ad48157f11d2953700a0c930328a/content.htm
    I think the integrated Excel mode shows '@08@'.
    Best regards,
    Guillaume

  • Change a modal JDialog to non-modal JDialog

    I created a modal JDialog initially, for some result i need change it to a non-modal JDialog, is there any set modal command can do it??

    Nope.
    The reason is because of program flow:
    System.out.println("first line");
    JDialog dialog = new JDialog(modal);
    dialog.setVisible(true); // blocks this flow if and only if modal is true
    System.out.println("second line");
    Try putting a button in the dialog which prints out "button pressed".
    If you press the button each time before closing the dialog you will get:
    when modal is true:
    first line
    button presed
    second line
    when modal is false:
    first line
    second line
    button prese

  • JButton on XP non-modal Jdialog doen't work.

    I recently upgraded from 1.3 to 1.4 while upgrading my OS from NT 4.0 to XP.
    In a stand-alone application I have non-modal JDialog's that are launched as threads so that I can have multiple instances of them running simultaneously. There are JButton's on the JDialog's which no longer respond to any mouse events even though I can execute them via the keyboard using the tab and enter keys. They work just fine under 1.3 or if I make them modal.
    Any thoughts?

    Hello,
    Issue is-
    There are JButton's on the JDialog's which no longer respond to any mouse events even though I can execute them via the keyboard using the tab and enter keys. They work just fine if I make them modal.
    Plz suggest

  • Non modal JDialog

    Hi All,
    I want a non modal JDialog which is used to show the message to the user that it is searching for the records, when a search is performed and records are retrieved from the database. When the search is going on user might hit cancel on the JDialog to cancel the search. My problem is, the cancel button on the Search dialog is not catching the event and user is not able to select the cancel option on the dialog.
    Here is my code :
    class SearchWindow extends JDialog {
    private JPanel btnPanel;
    private JLabel lblSearch;
    private JButton btnCancel;
    * Constructor
    public SearchWindow() {
    super((Frame)null, false);
    setTitle("Searching Shipment Legs");
    cancelled = false;
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    close();
    Container contentPane = getContentPane();
    contentPane.setLayout(null);
    addButtons();
    pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    setSize(new Dimension(300, 100));
    setSize(300,100);
    setLocation((screenSize.width-700)/2,(screenSize.height-450)/2);
    private void addButtons() {
    btnPanel = new JPanel();
    btnPanel.setLayout(new BorderLayout());
    lblSearch = new JLabel("Searching..........");
    btnCancel = new JButton("Cancel");
    btnPanel.setBackground(Color.lightGray);
    lblSearch.setBackground(Color.lightGray);
    btnCancel.setBackground(Color.lightGray);
    btnPanel.add(lblSearch, BorderLayout.CENTER);
    btnPanel.add(btnCancel, BorderLayout.SOUTH);
    btnCancel.addMouseListener(new MouseAdapter() {
    public void mousePressed(MouseEvent evt) {
    System.out.println("cancel");
    cancelled = true;
    close();
    btnPanel.setBounds(0,0,200,50);
    this.getContentPane().add(btnPanel);
    lblSearch.setVisible(true);
    btnCancel.setVisible(true);
    this.getContentPane().validate();
    public void close() {
    this.setVisible(false);
    this.dispose();
    public void show() {
    super.show();
    paintComponents(getGraphics());
    this.setModal(false);
    Any help is greatly appreciated.
    Thanks,
    Bhaskar

    Hi Haroldsmith
    I am calling this search window in one of my programs where on button click it will fetch the records from the database. When this process is on, search dialog is shown up. Ths dialog is shown correctly and its getting closed as soon as the search is completed. But the probelm is its not allowing me to click on cancel button.
    Bhaskar

Maybe you are looking for

  • I can't get version 11.1.4 to install because it fails to get the Mobile device program.  I don't have any mobile devices.  How can I overide this so I just get iTunes on my PC?

    I cannot get iTunes 11.1.4 to install.  I have tried uninstalling iTunes and downloading itues again witha manual install. It always fails because it cant get the mobile device part to work.  I am the administrator and I don't have ANY mobile devices

  • Problems with KDE

    Hey all, I've had some problems since the updates about a moth ago. Nothing is really a show stopper, but they are annoying. First prob is that applications disappear from the system tray in the bottom right of the screen in KDE. Not sure why this is

  • User Interface - auto detect does not work

    I have added the jQuery Mobile User Interface with Theme 50 to an old APEX 4.1 Application. When adding the new User Interface i checked the "auto detect" feature in the old User Interface. "Auto detect"- Help says: Select whether the appropriate use

  • Using addTimeInterval in NSDate

    I am just learning Objective-C programming. I have built a small Window with an NSDatePicker and two buttons. I want the buttons to increase/decrease the date in the DatePicker by 1 day. Here is the code I put together: @implementation CASDateIncreme

  • How to identify incoming URL in a web app?

    I have a web app A with a link to another web application B. When I click on the link B (actually a servlet), it takes me to the new application. Is there a way I can tell where I came from? i.e. Is there a way to get the URL of the originating appli