Resize frame

I use NetBeans 5.5
With help of GUI Builder I made a JFrame Form.
Then, I add a class which extends JPanel to my Form.
This Class has Panel with JTable and a panel with some buttons.
The problem is:
Frame doesn't resize after my class adding.
User sees half om my JTable. So he has to resize frame window manually.
Is there any way to get "real" size of my frame (including added components) and resize frame to "real" size?

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
* @author SShpk
public class FrameProblem extends JPanel{
    /** Creates a new instance of FrameProblem */
    public FrameProblem() {
        JTabbedPane tabbedPane = new JTabbedPane();
        JPanel baseBanel = new JPanel();
        JPanel buttonPanel = new JPanel();
        JButton button = new JButton("Control button");
            buttonPanel.add(button);
        DefaultTableModel dtm = new DefaultTableModel();
            dtm.setColumnCount(5);
            dtm.setRowCount(30);
        JTable table = new JTable(dtm);
            this.add(table);
            this.add(buttonPanel);
        //this.add()
    public static void main(String[] args){
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JFrame frame = new JFrame();
                frame.setSize(30,30);
                JTabbedPane tabbedPane = new JTabbedPane();
                tabbedPane.add("my class with JTable", new FrameProblem());
                frame.add(tabbedPane);
                frame.setVisible(true);
                frame.pack();
As you can see, everything is OK!
frame resizes to FrameProblem class dimension.
As i have wrote before, I think problem is in the interaction between GUI Builder designed components and manually wrote components

Similar Messages

  • Rescale GUI-Components on resizeing frame?

    Hello,
    how do I have to implement rescaling GUI-components when a frame (JFrame) is resized by a user on runtime?
    Should I have to use the observer-observable-pattern?
    thanx

    If you've got a layout manager then its automatic otherwise add a WindowListener to capture the resize event then resize them yourself.
    Rob.

  • I can't resize frames in InDesign CC 2014. Is there a setting for this?

    All was working fine at first. Now I can't resize any frames once they are drawn on the page. I can move them, just not resize them. I'm on deadline--a speedy answer is appreciated!

    Ah. I've figured out the issue -- it's not that I can't resize them. It's just that there is suddenly such a long response time from when I hold down the mouse button that I didn't realize it eventually would resize.
    Which is still a problem, but probably has to do with my computer memory.

  • HD timeline to DV50 timeline resizes frame size effects?

    I have a project in HDV I want to output to SD DVD.
    The edit was done in a HDV timeline. I have many effects where I resized the frame image size. (zoom in/zoom out etc.)
    I created a new sequence- DV50- NTSC Anamorphic.
    I did a simple copy and paste.
    Now all my re-size effects are way off. It's very strange:
    Clips I left at 100 (no change in image size) are now set to 50 in the Motion tab but they look fine(?) In other words the image correct size. O.K. fine.
    But clips where I shrunk the image (from 100 to 90) now display zoomed in very tight. Which makes no sense.
    Please I need to deliver this by the end of week.
    How do I get this into a SD timeline with all effects/resizes- exactly as they are in my HDV timeline?

    Export a QT movie...self contained, reference movie...doesn't matter. Then re-import that movie and drop THAT into your DV50 timeline. Everything will remain the same, except it will be letterboxed.
    Render.
    But really, you don't need to do this. This is an unecessary step. Just take that exported QT movie into compressor and choose the DVD preset (BEST settings) that matches your show time and SUBMIT. That will make an SD DVD.
    Shane

  • Resize frame and contents at the same time

    Is there a keyboard shortcut that can be used to resize the frame and the contents of the frame at the same time? Command + Option + < > works but only resizes the frame or the contents, not both at once.

    Ah yes: google a bit.
    This has been discussed a few dozen times and there are scripts around (eg. by Sandee Cohen) to fill the gap.

  • Have to resize frame

    I have made a GUI application which consist of many JPanels and classes that extends JPanels. However, when I do stuff, I have to resize my frame to see that anything has changed.
    What is the cause of this and more importantly how do I fix it?
    I am not sure wheter I should use, validate(), repaint() or updateUI(). But even so it doesnt seem to work. Have I just missplaced the call to one of them?

    What is the cause of thisThe LayoutManager doesn't know you've made changes.
    Invoke the layout manager. Generally the format of your code should be:
    panel.remove(...);
    panel.add(...);
    panel.revalidate();
    panel.repaint(); or updateUI(). Never use that. Did you read the API? That is for a LAF change.
    Maybe you should be using a [Card Layout|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html].
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Resizing frames issue in CS5

    When I resize an image or text frame by dragging a corner or side, there is a delay or a slowness where my mouse moves and the frame edge takes a while to catch up. Very annoying. CS4 worked great. Crisp and "on time" as it were. Anyone know if there's a setting that needs to be changed or maybe add more RAM? I've got 4 GB of RAM at present.

    Setting LSD to dealyed gives you the same behavior as CS4 where waiting a moment before dragging will show the object as it moves, but doesn't tax the system quite as badly. I suspect this is more a video RAM deficiency than a general resources problem, by the way.

  • Indesign Crash consistently while resizing frame

    Hi,
    I'm helping a company which publish a review every month with InDesign. The entire document is divided into three columns. Only some titles cover the 3 columns. That seems to be these titles which makes Indesign crashing. As soon as I resize a frame just above this kind of title Indesign crash instantly. I thought about paragraph style, links, layers, but all my tests has been uneffective, impossible to find the reason why Indesign crash. Does someone have an idea to help dealing with it ?
    I'm sorry for this incorrect English and hope some will understand my issue.
    Blaise

    Thanks IIIasss, yes, I did some research over the web to find some similar questions. I found lot of people having problems with Indesign, crashes and other issues but no one has the same problem as mine. Sometimes they report a crash when app starts, but I have never found the same problem as mine.

  • Can one resize frames in Safari

    If a web page has multiple frames sometimes you can change the size of the frames by clicking and dragging on the border between them. I haven't been able to make this work with Safari. Is there a trick?
    12 iBookG4 + Quicksilver 867   Mac OS X (10.3.9)   Safari 1.3.2

    Ah. I've figured out the issue -- it's not that I can't resize them. It's just that there is suddenly such a long response time from when I hold down the mouse button that I didn't realize it eventually would resize.
    Which is still a problem, but probably has to do with my computer memory.

  • Need to global find and scale and resize frame on a linked graphic

    I have a whole set of files that contain multiple instances of an icon set (placed AI file). All of these are formatted to flow in the text as anchored objects with various object styles. I need to make sure that all instances of the placed AI icons are scaled to 30% and that their frames are fit to content. I have a LOT of files and each one has at least 20 of these icons. I thought the Object find and replace would help, but unfortunately it will not let you search for links, and while I can search for the object styles, there's no option to change scale and the fit content options does not have the "fit frame to content" (and doesn't work anyway from the few tests I ran using "fit content proportionally"). 
    Does anyone have any ideas for how I can fix this globally in nearly 500 documents without having to manually select each icon and change the scale and apply the fit frame to content? I've done a handful of files this way, and it's VERY time consuming.

    First make sure this works by duplicating a file and testing.
    Make 1 image the size you need it
    Grep search for
    Find
    ~a
    Change to
    ~C
    if that doesn't work then try ~c (lower case) I can't remember how that works
    If it does work - then you can open 2 documents and choose "All Documents" in the Search field.
    If it's fine on 2 docs - then I'd say go ahead and do the rest.
    I stress to please use a duplicate set of files in case things go bad.

  • Resizable frames in ADF Faces

    Hi all!
    We have jspx-page.
    We are using ADF Faces HTML component <afh:frameBorderLayout>, which contains 2 <afh:frame> components for division of page content into areas.
    As a result html-page is generated, and it has 2 frames, but end user can NOT change frames width by draging.
    How can we fix that?
    Is there something like html "noresize" parameter in <afh:frame>?
    many thanks for reading this
    any help will be appreciated
    Renat

    I have the same issue and the quick answer is no. If you look into the source you will find that in the renderer oracle.adfinternal.view.faces.ui.laf.xhtml.FrameRenderer.java that noresize is hard coded.
    They must have had a reason (I hope) but I have no idea what the reason is. Maybe its something for Trinidad or someone from oracle can supply the reason.
    Thinking about ways to overcome this issue

  • Possible to have UILabel auto-resize frame?

    I'd like to display a block of text, but it's not known at compile time. I know I can set the numberOfLines to 0 for the UILabel and it will automatically use as many lines as it needs, but what about the frame? I want to display content immediately beneath it and I don't know how tall of a rect to provide when I create the UILabel initWithFrame.
    Is there something like UILabel.resizeFrameHeightBasedOnTextWrapping?
    I've checked the docs and can't find anything like this.
    Thanks

    Solved this myself. sizeWithFont() message series should do the trick.

  • Resize frame and content proportionately

    Hello
    When i try to use Selection tool+Shift+Command–drag in mac or Selection tool+Shift+Ctrl–drag in PC
    to resize an image  or some text proportionately it doesn't seem to work like in illustrator, indesign... it does resize but not proportionately.
    Is it possible to have the same shortcuts like this one in Adobe Muse? it will make it easier to place images and change size after.
    Thank you.

    Hi Maria
    It works just the opposite of what you are familiar with. Proportional scaling is built in, just drag a corner without holding any keyboard buttons down. To scale disproportionately you use the keyboard keys
    hope that helps,
    Michael Riordan
    Owner/Adobe Certified Instructor
    Digital DesignLab
    www.learnadobesoftware.com

  • Safari Frame Resize

    I have a QNAP NAS with a management interface that uses resizable frames.
    Is there a touch gesture that will allow me to resize theses frames on my iPad?
    Thanks in advance.

    I have a QNAP NAS with a management interface that uses resizable frames.
    Is there a touch gesture that will allow me to resize theses frames on my iPad?
    Thanks in advance.

  • InDesign auto-size frame feature not working in real time in InCopy why?

    We have just recently migrated from InCopy CS4 to CS6 to take advantage of the new features like the auto resize frame option, however it now seems that this feature is not working in real-time.
    Basically the steps are needed to be complete before it auto-resizes the frame in InCopy, we use both layout and assignment based workflows:
    1. From an ID document ('doc1'), exported a 'layer' to IC, certain frames are set to auto-size in height using the text frame options. So that editorial can review and make changes to text and the frame should resize according to the specifications set. IC stories are saved to a folder located in a content folder inside the top issue working folder.
    2. Editorial opens the IC software, then opens the ID 'doc1'. Check’s out correct .icml file and makes edits to frame with auto resize.
    3. Frame does not resize according to text frame set options and InCopy file does not respond in same fashion as InDesign.
    4. Change only occurs when InCopy file is closed and updated in InDesign, which is frustrating as this feature would save huge amounts of time serving editorial requests.
    Has anybody experienced this type of workflow problem? If anyone can provide mw with some pointers as to what can I do to get this to update in real time perhaps run a script? Update file in InCopy and refresh I will very much appreciate their assistance. I have run out of ideas.
    Thanks!

    We've had all sorts of problems with this feature as it should've worked straight out of the box but after some testing we have found that its something to do with the way you open the actual file in InCopy. Which is far from ideal and should have been UAT by Adobe before release.
    This will not work consistently work if you open the designed .indd or .icma file in InCopy using the file open command within the application.
    If you need this to work, the InCopy user has to open the .indd or .icma file by dragging and droping from OS windows explorer into InCopy, we use Windows 7 acrros all the teams. Check out .icml files add text changes to the set auto resized frames, this process will expand/collapse the frames to fit the content but as you have to use the drag and drop method to open the .indd and .icma file, 2 users cannot access the same time doc at the same time (a serious flaw in the programming architecture!) which stops people working in parallel. Save changes, check in .icml content and close .indd or .icma.
    However the flaw comes in if you then open the .indd and .icma file in InCopy using the file open command within the application, before an InDesign user opens and saves the file (updates the design). The corrections added in the previous stage above, will not show the frames expanded/collapsed to take in the added text and instead show over matter???? The only way around this is to ask an InDesign user to open, update and save the design that way the InCopy user will see the same result no matter what file open method they use.
    Another suggestion is to design the page to have some of the auto resize frames anchored within main body of text and that way the frames will expland/collapse when checking out and editing the content. However, this does cause issues with InDesign crashing etc. so we have tried to stop this method within the working group.
    Have you experienced other more serious issues with InDesign crashing consistently when re-importing .icml files? See other forums here:
    http://forums.adobe.com/thread/671820?start=80&tstart=0
    http://forums.adobe.com/message/5045608#5045608
    As far as we can see this is a major flaw in how the application(s) work, we have an enterprise agreement with Adobe and purchase a large volume of Adobe products globally but so far the technical support team are unable to find a solution to this and I'm not hopeful of any resolution soon even with the new release of Adobe CC.

Maybe you are looking for