Problem resizing the JDialog???

hi,
I have a JDialog to which I am adding a JTable and JButton to search.
Based on search condition the table gets populated.
Problem here is
I give search condition 1 and puplate the table after that I resize the JDialog
Now i again serach it.Now the JDialog's size goes to the previous thing it does'nt take the resized size.
in the end of my seacrh action listner I am doing
this.pack();
this.setVisible(true);
this.setResizable(true);While running in debug mode I noticed once it execute this.pack();
the resizing is gone.but if I remove this.pack() the JTable is not shown...
Any idea about this problem??
thnx
neel

The pack() method lays it out according to the preferred size of the content.
You need to either only pack it when you first create it, or note the actual size before packing and if it's non-null and non-zero then restore it after packing.

Similar Messages

  • Problem resizing Viewport with WebDeveloper in WinXP and Vista

    I'm having a problem resizing the Viewport with WebDeveloper running in FF10 & FF11 on my WinXP and Vista machines. Quite simply, I'm trying to resize the Viewport to 320x420pixels (to represent an iPhone) but can't get it to go below 510px.
    There's no problem in FF1 on Win7. I have contacted Chris Pederick, the developer of WebDeveloper, and he says his code is tha same in all cases, and pretty basic JS. So possibly the fault lies in the browser. I've not noticed this problem in earlier versions of FF (i.e around 3.5)

    Try to hide all toolbars or open a second window and hide them there to see if that allows to make the window smaller.

  • My iPod Touch 3rd Gen is having problems with the touch screen being unresponsive, too responsive, freezing and constantly resizing. Is this a common problem? Is there a fix?

    My iPod Touch (3rd Gen) is having problems with the touch screen being unresponsive, too responsive, freezing and constantly resizing. It varies between not responding when I tap the screen and acting as if I double-tap or tap and hold when I tap. Every so often it freezes for a minute or so and then comes back. The scren is constantly changing sizes too such that I often can't see most of the top status bar or other edges. This makes typing almost impossible, ruins most games and generally makes everything difficult, but otherwise the iPod is working correctly. Powering off, shutting down apps, letting it sit have not worked. This has happened once before months ago, but the issue resolved itself somehow. Is this a common problem? Is there a fix?

    Try this for the freezing
    http://www.apple.com/support/ipodtouch/assistant/ipodtouch/
    Or if they don't work put it into recovery mode
    See here
    http://www.apple.com/support/ipodtouch/assistant/restore/
    Then restore
    http://support.apple.com/kb/HT1414

  • Problem with dragged component after resizing the frame

    My application is simple: I am displaying an image on a panel inside a frame (JFrame). I am able to drag the image inside the panel. My problem is that, after dragging the image around, if I am resizing the frame, the image goes back to its original position.
    Does anyone know a workaround?
    I have been using the sample provided by noah in his answer (reply no. 3) to a previous question on this forum: http://forum.java.sun.com/thread.jsp?forum=57&thread=126148
    Thank you!

    Chek out the visibility of your components. Some operations may render them invisible. Use the setVisible( boolean ) to make them visible.

  • Problem in resizing the datafiles

    Dear Gurus,
    We had a critical situation in one of our Streams enabled ODBPROD/HDBPROD configurations.
    We had a tablespace "STREAMS" in HDBPROD database which replicates data from ODBPROD of size 86GB of which 80GB is free.
    When we tried to resize the datafiles which are of each 8GB each, we are receving the error that some objects exists in the extents, even when I tried to reduce the file size by 100M.
    So, we are plnning to do a re-org on the tablespace and the optiosns which I have are.
    1) MOve the tables/objects with inthe tablespace.
    2) COALESCE the tablespace
    3) Create a new tablespace and move al the objects from Streams tablespace to the new one and once again create/rename the tablespace with STREAMS and move back iff created.
    My doubt here is while going with option 3) is it going to affect the stream apply process or any effect on the DML operations are reported.
    Please help me on this.
    REgards,
    Kumar

    How to Use Layout Managers:
    http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html
    When using BorderLayout, components added to the CENTER will expand with the available size.
    When using GridLayout all components will expand to the available size.

  • Dynamic resizing in JDialog using setSize not working properly on solaris

    can anyone help..
    Dynamic resizing in JDialog using setSize is not working properly on solaris, its work fine on windows.
    i have set Jdialog size to setSize(768,364),
    when i dynamically resizing it to setSize(768,575); it doesn't get change but when i move dialog using mouse it gets refreshed.
    this problem is only happening on solaris not on windows.

    Hi,
    It's only an approach but try a call of validate() or repaint() after re-setting the size of your dialog.
    Cheers, Mathias

  • Photoshop CC: Have a template that I moved image into.  Image is too small.  How do I resize the image while in the template?  Or must I go to original image file and resize there again and again until I get the right fit?

    I have a template that I am able to plug different pictures into at different times.  The problem is that when I plug an image into that template, I find that the image is either too big or too small.  Is there a way to plug the image into the template and resize the image (and not the template itself) OR will I have to go to the file with the original image and resize it there and then try to plug it in to the template to see if it fits------and if it does not fit, go back to the original file with the image and resize it again and see if that fits---and so on and so on...........?  I have tried the" image size" option but it's hit or miss------mostly miss!
    Thanks!

    Read up on Smart Objects. It looks like you have no idea as to how to create and use them.
    Jut create a Smart Object from the layer containing whatever it image it is that you are "plugging into your template".  But you do need to learn the application at its most basic levels.
    Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.  You cannot learn Photoshop in a forum, one question at a time.
    Or is it possible that you don't even have Photoshop proper but the stripped-down Photoshop Elements?"
    If the latter is the case, you're in the wrong forum.  This is not the Elements forum.
    Here's the link to the forum you would want if you're working in Elements.:
    https://forums.adobe.com/community/photoshop_elements/content
    If you do have Photoshop proper, please provide the exact version number of that application and of your OS.
    (edited for clarification)

  • How can i only allow the activation of the JDialog on top?

    Hi to all,
    i have a problem with a mask swing
    Well, my problem is this:
    In a window, when i click on save button, it's open a customizing JDialog. But i would like how i can deny a click out of this JDialog, that is on top.
    In other words, in this situation, with a jdialog on top, if the user click once again on the save button or out of this jdialog, the jdialog must stay on top and active.
    How i can this?
    Please help me!!
    the code that realize my class is this:
    public class ConsegnaOrdineDialog extends JDialog implements ActionListener {
         private JOptionPane optionPane;
         private String dataOrdine;
         private JButton si, no;
         private JTextField dataConsegna;
         public ConsegnaOrdineDialog(String dataOrdine) {
              this.dataOrdine = dataOrdine;
              dataConsegna = new JTextField();
              si = new JButton("Si");
              no = new JButton("No");
              si.addActionListener(this);
              no.addActionListener(this);
              JPanel panel = new JPanel();
                 panel.setLayout(new BorderLayout(5, 10));
                 panel.add(dataConsegna, BorderLayout.NORTH);
                 panel.add(si, BorderLayout.WEST);
                 panel.add(no, BorderLayout.EAST);
              Object[] options = {panel};
              optionPane = new JOptionPane("La data �:",
                    JOptionPane.QUESTION_MESSAGE,
                    JOptionPane.NO_OPTION,
                    null,
                    options,
                    dataConsegna);
              setContentPane(optionPane);
         public void actionPerformed(ActionEvent e) {
              if (e.getSource() == si) {
              if (e.getSource() == no) {
                   super.dispose();               
    }

    in the constructor
    setModal(true);

  • How do I keep text from distorting whenever I resize the text box in Illustrator?

    This has happened to me but that was over two years ago and cannot remember how I fixed it. I did not change any settings. It just happened when I rebooted my computer and opened up the file I am working on. Any suggestions will be greatly appreciated.
    Thanks!

    What version of Illustrator are you using? Text boxes now have two modes. When you are looking at a selected text box, you should see an arm sticking out on the right side with a small circle at the end of it. Double-clicking on that will change between area type mode, where you can resize the box but not the text, or the other mode (sorry- forgot the official name) where you are changing the look of the type itself when resizing the box.
    Am I understanding your distortion problem correctly?

  • Not closing  the JDialog causes the application to freeze???

    Dear all,
    I am developing an application that contains dialogs.
    if a user does not close the dialog and opens one of the
    other window applications, e.g. Outlook Express, then clicks on
    the application again by clicking on
    the reduced window/icon at the bottom of the screen,
    then the dialog is not displayed anymore (since it is at the back of
    the main application window) and the application is frozen!?
    My code looks something like the following:
    JDialog totalCostDialog = new JDialog();
    totalCostDialog.setModal(true);
    totalCostDialog.getContentPane().add(new GrpTotalsDialog());          
    totalCostDialog.addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent we) {                    
         totalCostDialog.dispose();
    totalCostDialog.setLocation(700, 300);                         
    totalCostDialog.pack();
    totalCostDialog.setResizable(false);     
    totalCostDialog.toFront();
    totalCostDialog.setVisible(true);          
    I thought the to.Front() piece of code would solve the problem,
    but apparently it does not?
    Does anyone know the solution to this problem?
    Kanita

    Rather use the JDialog constructor that passes in a JDialog or a JFrame. That way your new JDialog will be connected to a base in your application.

  • Why does Preview automatically resize the text box to cut off the last character of added text? How do I fix it?

    Why does Preview automatically resize the text box to cut off the last character of added text? How do I fix it?
    I use the Tools > Annotate > Add Text feature, and when I click away after adding text, it automatically changes the text box size such that the last letter -- or last word -- gets bumped off into an invisible line below it, forcing me to manually adjust every single text box. It is highly annoying when trying to complete PDF forms (e.g. job applications).
    It appears to be a glitch, quite honestly, an error resulting from Apple's product design. Has it been fixed in the new operating system (for which they want $30)?
    I would very much appreciate any help you can provide! Thank you for your time.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • I can't resize the reply window in Mac Mail

    My mail is working fine.
    If I write a new email it all looks okay.
    If I reply or forward an email the window is so wide it would stretch maybe 3 times the width of my screen, so if I want to use any of the tools in the top right toolbar I have to drag the window across.
    I can resize  up and down to make the window taller or shorter but I can't make it fit onto my screen widthways.
    I have rebooted, hit zoom and now I'm stumped.
    Any suggestions?
    Thanks

    Such a simple fix and I spent over an hour on this:
    http://www.adobepress.com/articles/article.asp?p=1930509&seqNum=3
    This is the part that helped me in case anyone goes nuts trying to figure this out. (#2 solved my problem):
    Working with the application window on Mac OS
    In Normal screen mode on Mac OS, resize the application window by dragging its lower right corner.
    Click the green Zoom button (), located beside the Close and Minimize buttons at the left of the title bar. The application window expands to fill the screen. Click the Zoom button again to return to the previous window size.
    Reposition the application window on your screen by dragging the title bar.

  • Problems with the background image size in a photobook

    Hi there, I really need help here. When I make a photobook I want to display my images large, taking the whole page. To do that I put the image as a background and it's OK. My problem is that when I do this, iPhoto always crops it. I have to use the move tool to move the image up and down, left or right to chose a best position. I don't want to do this, I want my image to be shown perfectly from end to end. I have to resize the image in many ways, even used the book's native resolution but it still doesn't work. If I choose "fit photo to frame size" I end up with two stripes at the top and the bottom of the page.
    Please help me, what size should I resize my image to, so that iPhoto displays it as it is?
    Thank you

    Hi
    The fact you are using a Mac is why both myself and JCellini assumed you where using a pre IE7 version.
    But the code you are using to test in IE will cause a problem with any 'virtual machine' such as crossover, because it cannot reference anything outside its own assigned section of the drive, and referencing the png in the way you are would be for it an invalid reference, it also would not work in any browser when you uploaded the site.
    Change - background-image:url(file:///Macintosh  HD/Users/myname/Documents/websites/test/Test/images/test_back.png);
    To - background-image:url(images/test_back.png);
    But if the region is not editable I would suggest you temporarily make it so, externalize your css to a css file, insert a link to the external css file in your head content, then lock the region once again. This way you will always be able to edit your css without worrying about 'locked regions'.
    PZ
    www.pziecina.com

  • Panel doesn't display properly until I resize the frame

    Hiya folks,
    I'm currently trying to write a simple piece of music notation software. This is my first time using swing beyond a relatively simple JApplet and some dialog stuff. Anywho, I ran into a pretty discouraging issue early on. So far I've got a frame with a menu bar and a toolbar on the bottom border. The toolbar contains a button which should draw a new staff panel containing 11 panels (potentially more) within it, alternating between lines and spaces. Sort of like this:
    import javax.swing.*;
    import java.awt.*;
    public class Staff extends JPanel {
       private static JPanel nsp1,nsp3,nsp5,nsp7,nsp9,nsp11;
       private static JPanel nsp2,nsp4,nsp6,nsp8,nsp10;
       private ImageIcon image= new ImageIcon(this.getClass().getResource( "icons/treble clef.gif"));
        public Staff(){
        setLayout(new GridLayout(11,1));
        add(nsp1= new NoteSpace());
        add(nsp2= new LineSpace());
        add(nsp3= new NoteSpace());
        add(nsp4= new LineSpace());
        add(nsp5= new NoteSpace());
        add(nsp6= new LineSpace());
        add(nsp7= new NoteSpace());
        add(nsp8= new LineSpace());
        add(nsp9= new NoteSpace());
        add(nsp10= new LineSpace());
        add(nsp11= new NoteSpace());
    static class NoteSpace extends JPanel{
        public NoteSpace(){
        setPreferredSize(new Dimension(this.getWidth(),2));
    static class LineSpace extends JPanel{
          public LineSpace(){
          setPreferredSize(new Dimension(this.getWidth(),1));
          public void paint(Graphics g) {
              super.paint(g);
              g.drawLine(0, (int) super.getHeight()/2, (int)super.getWidth(), (int)super.getHeight()/2);
    }Anyway, this panel displays as a tiny box wherein nothing is visible until I resize the frame. Really frustrating. And I have have no idea what the problem might be. Here's the actionlistener:
    jbtcleff.addActionListener(new ActionListener (){
            public void actionPerformed (ActionEvent e){
                staff.setBounds(50,panel.getHeight()/2,panel.getWidth()-50,panel.getHeight()/2);
                panel.add(staff);
                staff.repaint();
            });...which is located in a custom jtoolbar class within the Main class, an extension of JFrame:
    public class Main extends JFrame{
       JMenuBar jmb=new CustomMenuBar();
       JToolBar jtb= new CustomToolBars("ToolBar");
       static boolean isStaff=false;
       static boolean isNote=false;
       static JPanel panel = new JPanel();
       private static Staff staff= new Staff();
        private static Toolkit toolkit= Toolkit.getDefaultToolkit();
       private static Image image=toolkit.getImage("C:/Users/tim/Documents/NetBeansProjects/ISP/src/MusicGUI/icons/treble clef.jpg");
        private static Cursor noteCursor = toolkit.createCustomCursor(image,new Point(0,0),"Image"); 
       public Main (String m) {   
            super(m);
            setJMenuBar(jmb);    
            getContentPane().add(jtb,BorderLayout.SOUTH);       
            panel.setLayout(new CardLayout(60,60));
            getContentPane().add(panel);
    public static void main (String[]args){
            JFrame frame= new Main("Music");
            frame.setSize(800,400);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            frame.setIconImage(image);
           Sorry for all the code. I'm desperate.
    Thanks!

    Oh my... have you been through the Swing tutorial?
    Let's look at some of your code,
    static class NoteSpace extends JPanel{
        public NoteSpace(){
        setPreferredSize(new Dimension(this.getWidth(),2));
    static class LineSpace extends JPanel{
          public LineSpace(){
          setPreferredSize(new Dimension(this.getWidth(),1));
          public void paint(Graphics g) {
              super.paint(g);
              g.drawLine(0, (int) super.getHeight()/2, (int)super.getWidth(), (int)super.getHeight()/2);
    }Here, NoteSpace and LineSpace are being set to a preferred size of 0x2 pixels, and 0x1 pixels respectfully. If you want them at 0 width, how do you expect them to show? In particular, NoteSpace isn't doing anything special. It's just a panel. Why an inner class? Lastly you should not override paint() for SWING. That's AWT stuff. For Swing, you override paintComponent(Graphics g) .
    Then we have this
    jbtcleff.addActionListener(new ActionListener (){
            public void actionPerformed (ActionEvent e){
                staff.setBounds(50,panel.getHeight()/2,panel.getWidth()-50,panel.getHeight()/2);
                panel.add(staff);
                staff.repaint();
            });I'm not sure what the variable jbtcleff is, but it seems you are adding your Staff panel to "panel" every time a button is pressed.... why? Why not just add it once (outside the action listener) and be done with it. Your panel object has a CardLayout, so I assume you meant to create a new+ staff panel everytime a button is pressed, and then add it to the card layout panel. Even so, setBounds(...) does not seem pertinant to this goal. (In fact, in most situtations the use of setBounds(...) is the antithesis of using layout managers).
    The problem you mentioned though seems to be related to the use of a JPanel (your Staff class) that adds zero-width compontents to a grid array.

  • How to resize the video in Compressor?

    Hi all, my first post here,
    I just know  we can't optionaly resize the video in Final Cut Pro and
    using the compressor can resovle this problem,
    It's not very convenient to resize the video in FCP.
    i wanna ask how can i  resize the video in compressor
    Thanks a lot

    First, you should carefully think why you'd need to resize. You can export from FCP X to the standard sizes, both HD and SD. Do you really need some nonstandard size?
    Keep in mind that usually you'll get the best quality if you edit in the desired final size, rather than resizing afterwards.
    If you do need to create a video in some nonstandard size, like, say 1080x1920 (i.e. in "portrait" form), there is a way to do it:
    http://library.creativecow.net/articles/payton_t/FCPX_Custom-Resolution-Timeline s/video-tutorial
    With Compressor you have many pre-made defaults for different kinds of devices. Also, you can export to Quicktime and tweak the settings to get a desired size.
    1-Drag one of the existing settings (in the example below, I used SD 480p)
    2-Select it
    3-In the Inspector, select the "Geometry" tab
    4-Choose "Custom" and enter the desired size.
    5-Change the other properties (such as codec, under the "Encoder" tab), as needed
    5-Choose "Save As..." and save it (give a suggestive name, say "Portrait") so that you can later reuse it as needed.

Maybe you are looking for

  • Firefox crashes when I try to watch a movie type youtube, has just installed nero and Nikon software on my computer

    Firefox crashes when I try to watch a movie type youtube, has just installed nero and Nikon software on my computer. This began shortly after I installed my new CD burner with Nero 9 burning software, about the same time I also installlerade my new N

  • PO Output message triggering even when it is on HOLD status

    Heelo SAP Gurus, I have come across a issue where the PO output message is triggering even when the user puts the PO on HOLD status. It is happening randomly i.e,not for all POs. Plesae guide me on this Santosh

  • Openning oracle connection hangs in aspx page

    I have an application(on win2k) which connnects to oracle database(on Solaris machine).Application connects to DB & executes a simple query. As .NET application it works fine. if the same code is copied & pasted in a aspx page, page just hangs. Have

  • Database Status Inactive Sessions

    On OAM Applications Dashboard > Navigate to "DATABASE STATUS" > Sessions "#" I see alot of inactive sessions. Is it okay to terminate all of the inactive sessions? does it affect system performance? THanks! Message was edited by: chaseeem

  • Time & Date Stamp when sent

    I would like to create a function that would time & date stamp my form at the time it's being sent.  I have a button designed to e-mail the PDF to a specific e-mail inbox.  Is there a way to time & date stamp this form at the time the individual pres