How to make JFrame default Maximum size state?

Hi all,
Is there any one know how to construct a JFrame that setMaximum when screen show?
another word mean the JFrame in Maximum state byb default.
regards,
elvis
scjp

Pheeeewww...
Don't people ever search the forum and read older posts?
Both the question and the partly wrong answer have appeared many, many times before.
In pre-1.4 Java you simply cannot maximize a frame.
The 'solution' is probably the best you can do, but it does not really maximize the frame:
* The user can still move/resize it.
* It does not take into account the size/position of the windows task bar or any other window manager palette windows.
There also has been a solution that uses the Robot class to simulate a click on the maximize button, but that's a real dirty trick, that won't work in applets and strongly depends on the exact layout of the window's decorations.
In Merlin you can programatically maximize a frame as well as find out the screen's insets (resulting from the task bar...)
Stephen

Similar Messages

  • How to set the default maximum size for java's heap?

    Hi!
    Im trying to set the default max size for the java heap - but not from the command line.
    I would like to set it higher as default on my computer.. how can I do that?
    thanks!

    >
    ...You may increase the memory heap only when you're launching a new JVM.>Much like IWantToBeBig does.
    OTOH, it this is an app. with a GUI, it is easier to launch it using webstart, and request extra memory in the JNLP descriptor (the webstart launch file).

  • How Do You Set a JFrame's Maximum Size?

    Can someone show me a quick example? The JFrame can be empty, I just want to know how to set it's maximum size. I tried using setMaximumSize() and it doesn't work for some reason but setMinimumSize() works fine.
    I tried it using a BoxLayout and even using null as a layout manager and can't get it to work. I heard that the other layout managers don't allow you to set the maximum size of a JFrame so that is why I tried it with the layouts that I did.

    Darryl.Burke wrote:
    Are you displaying your MyFrame as a top-level window or adding it to a parent JFrame with null or BoxLayout set?
    Maybe the method you're looking for is setMaximizedBounds(Rectangle bounds)
    You could also try this: setBackground(...) to something other than the default background and run your program again.
    I'm at work and can't try ou any of my suggestions, so please post back if you get any progress.
    dbsetMaximizedBounds is a little better but not really what I was looking for. I can still make the window go passed the set boundaries when the window hasn't been maximized.
    Also, I checked that method setBackground, that only seems to change the color, is that the same method you were referring to?

  • How Do You Set the Maximum Size of a JFrame?

    Can someone show me a quick example? The JFrame can be empty, I just want to know how to set it's maximum size. I tried using setMaximumSize() and it doesn't work for some reason but setMinimumSize() works fine.
    I tried it using a BoxLayout and even using null as a layout manager and can't get it to work. I heard that the other layout managers don't allow you to set the maximum size of a JFrame so that is why I tried it with the layouts that I did.
    I tried the following code (imported the necessary classes), but it does not work...
    public class MyFrame extends JFrame
        public MyFrame()
            super("TestFrame");
            setLayout( new BoxLayout(getContentPane(), BoxLayout.X_AXIS)  );       
            setMaximumSize( new Dimension(400,200));
            setSize(300,150);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setVisible( true );                
    }// end class

    Reposted from
    {color:#0000ff}http://forum.java.sun.com/thread.jspa?threadID=5236259{color}
    @OP:
    When you repost a topic, please always provide a link to the previous post so people can check what suggestions were already offered (and didn't solve the problem).
    Better still, give a short summary of the advice you have already tried.
    I suggested setBackground(...) so you can see whether your MyFrame is actually occupying the entire real estate of the window. Looks as if trying it out (which I would have done for you if I'd been at home, where my JDK is) would have been too much effort for you.
    I'm pretty much a novice in Swing, but I can tell you this: setLayout controls the layout of components added to the JFrame, not the layout of the frame with respect to its parent container.
    Luck, Darryl

  • How to change the default window size display font size on Lync 2013 main window?

    Hi champs,
    Just a simple non-technical question: How to change the default window size display font size on Lync 2013 main window on Windows 7 desktop?
    Thanks,

    Hi,
    Did you mean change the Lync: Change the Default Font and Color of Instant Messages just as Edwin said above?
    If not, as I know, there is no natural way to change it.
    If yes, on the latest version of Lync 2013 client, there is a new option “IM” on Lync client “Options” list. And you need to change the default Font and Color of IM in the interface of “IM”.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • Can someone tell me how to make my screen full size with Safari ?  I am using a Mac osx 10.6.8.

    Can someone tell me how to make my screen full size on my Mac OSX 10.6.8. using safari.  I know this is a simple question. I have always had it on full screen and recently had it worked on remotely and now I can't get the screen back to full size.  I appreciate any advise you can offer. Thank you

    from the BetterTouchTool blog, older versions can be obtained using these links:
    The last 64bit Snow Leopard (10.6 ) version (v 0.939 ) can be downloaded here
    <http://bettertouchtool.net/btt0.939.zip>
    If you are using an older 32bit Mac you’ll have to use this version: 0.785
    <http://bettertouchtool.net/btt0.785.zip>

  • How can i increase the maximum size of a text column in Access

    hello,
    i am inserting data in the MS-Access database through my servlet and am getting the exception whenever the length of the text data is more than 255 characters as in Access the maximum size for character data column is 255 can anyone tell me if there is any way by which i can increase the maximum limit of the column size in Access ,i.e. to make it more than 255.

    A text field in Access has a maximum size of 255 characters. If you want to store text information in Access larger than 255, you need to use the memo rather than text data type. There are special considerations for using an Access memo data type and accessing it through JDBC. Specifically, I believe it must be accessed as a binary object (BLOB), rather than text when using the JDBC-ODBC bridge. There are lots of discussions within these forums regarding how to manage, and the issues with using the Access memo data type.
    Good luck!

  • How to set the default page size ?

    Hi there,
    I just bought a 15.4" Macbook Pro.
    When I use Safari to surf, I found that the image/fonts are to small for my liking.
    So I did VIEW > ZOOM IN two times & the image/fonts & it become satisfactory.
    But after I shutdown & restart the laptop again, I find that whenever I startup, the page in Safari when back to the smaller setting & I have to click VIEW > ZOOM IN twice again .
    My question is how to make this settings permanent ? It is irritating having to do VIEW > ZOOM IN everytime I start up the system !!
    Any ideas ?
    Thnaks

    In Safari, go to Safari >> Preferences. Click on the Appearance tab. Set the standard and monospaced fonts. That not only sets the default fonts for web pages (many web-sites will specify other fonts), but also the default sizes (though web-sites can specify alternate sizes). Also, on the 'Advanced' tab, there's a checkbox labeled 'Never use font sizes smaller than' followed by a drop-down. This permits you to prevent the text from going beneath the specified size.
    The advanced tab also permits you to provide a CSS stylesheet to apply as the default. If you know CSS, this can be very powerful.

  • How do I set default font size?

    Some programs (most importantly for me, Thunderbird) use a default font size that is too small for my eye comfort. Some (such as Firefox) allow me to change the font size, but Thunderbird does not (though there is a menu item to change font size, which does not work).
    I gather that such programs are using a default system font size. So I would like to change this. Some Help articles suggested that I could do this from the Font Panel, but they give no indication where to find the Font Panel. I cannot find it in System Preferences or via the Spotlight.
    I am using OS X 10.4.7
    I am computer-literate, but new to the Mac, having had this computer for about a week and a half.
    P.S. In Thunderbird -> Preferences -> Fonts there is an option to configure the fonts used by Thunderbird. The settings affect messages, but not the main window with the message list. However, at this point I'd really like to set the system default so all programs that use the system default will be affected.
    Thanks.
    Daniel

    This still does not work.
    I tried all of them.
    Theme Font & Size Changer
    Big Buttons
    Default FullZoom Level
    NoSquint.
    It only works for that page of that web site, as soon as you leave you start all over again.
    Can't we just say Firefox messed up and needs to revert to the way it used to work without have to do ANYTHING to adjust any sizing.
    This is utterly ridiculous.
    It's a web browser for GOD sakes...not the OS. It shouldn't be doing anything but displaying web sites with NO INTERVENTION by the user for each and every page.
    Why are programers always looking for ways to take a working product and make it useless???

  • How do you change default note size font

    I accidentally posted this for iWork previous to 08, sorry. I want to change the default font size for all notes in a file. I realize you can change them one slide at a time by using Cmd-+or-, but I don't want to have to do every one separately since I'm just trying to record a narration. Likewise I still have no answer to how one sees presenter notes on the slide while recording a narration! Help!

    Thanks, Sam. Yes, I could easily change the individual slides, too, but there seems to be a rather large hole in the program, if you're promoting this for kiosk use or even just being able to send to possible interested parties without being present and therefore you want to narrate it. AARGH! Is there NO one at Apple who even occasionally looks at it's own forums! And it's not in the Knowledge database either.

  • How to make the  buttons same size on the toolbar

    Hi All,
    Can anyone please tell me how to make the size of buttons on the toolbar to be same .
    And i also want to add combo box at the right side of my menubar with prefered size.
    Please send me the solution if anyone knows . Thanks in advance.
    Regards,
    Shankar.

    how to make the size of buttons on the toolbar to be same Create a panel with a GridLayout. Add the buttons to the panel then add the panel to the menubar.
    add combo box at the right side of my menubar Read this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html]How to Use Menu Bars for an example.

  • How to make the default tree row selection programatically

    I have one use case where I am displaying the tree table based on some parameter which is just for filtering the table and display the part of hierarchy.
    The problem here is I want to make a default selected row when the tree will be rendered to UI based on the primary key(that is the input parameter).
    can you please tell me how to do this.I am using jdev 11g.
    thanks,
    Harsh

    Hi,
    for this you need to know where in the path the PK is. If e.g. the PK is for a second level node then you need to pass the first level node PK as well. Nodes in a tree are defined as ArrayLists. So unfortunately your question doesn't provide enough information
    Frank

  • How to make jframe transparent?

    Hi
      some software's uses the monitor as a whiteboard to draw or to type text. How is this possible? I mean i thought that by making a  jframe (full screen) transparent we should be able to do this?   Is my understanding right? if so how to make the jframe transparent? when jframe is transparent will we be able to draw on it?

    Try this:
    public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
      @Override public void run() {
      JFrame f = new JFrame();
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      f.setUndecorated(true);
      f.setBackground(new Color(0,0,0,0));
      f.setExtendedState(JFrame.MAXIMIZED_BOTH);
      f.add(new JComponent() {
      @Override protected void paintComponent(Graphics g) {
      g.setColor(Color.BLUE);
      ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      g.fillOval(0, 0, getWidth(), getHeight());
      f.setVisible(true);
    Message was edited by: 946128 in respose to PhHein's comment

  • How to make Viewer default (again)?

    I upgraded Adobe Reader and every time it opens it asks me doe I want it to be my default viewer for PDFs. I always clicked NO but just recently clicked YES by mistake. Now it opens every time to see PDFs.
    I don't really like it, liked Apple Viewer better. How can I make it default again?
    Thank you,
    Zack

    I have nearly the same issue: Acrobat always asks if I want it to be my default viewer. After many dozens of times saying "no," I finally accidentally clicked "yes." (It also has a checkbox called "Don't sk this again," but it still asks every time).
    Anyway, I also want to use Preview as the default, and I can use the Get Info trick, but there's a rub: Before Acrobat did this, there were certain pdf files that I wanted opened in Acrobat, and not Preview. They had the Acrobat icon, not the preview one. If I do the Get Info trick, I have a feeling that they will be changed to open in Preview instead of Acrobat. So my questions are
    1) Will this actually happen?
    2) Where is the info stored that makes it possible for some pdfs to be opened with one app and other pdfs to be opened with another app?
    3) When I accidentally let Acrobat change the default, is this identical to having chosen Get Info on a pdf file and selecting "Change All..." to Acrobat, or is it just changing some system-wide preference about which viewer should be the default—a preference that, I hope, can be changed back.

  • How to make ffox default Mac brwsr. Currently can only make Safari default; per ffox help.

    Just want to make ffox default; ff help only discusses making Safari default browser. Your cookbook questions are not very applicable to this simple problem

    If doing it from within Firefox (see [[How to make Firefox the default browser]] ), then you can do it through Safari. See [[Setting Firefox as the default browser does not work]]

Maybe you are looking for

  • AVGetOptimizerPresets and 'Standard' presets - name is Acrobat language-dependent?

    I am calling  AVGetOptimizerParamsForPreset with "Standard" as the presetName parameter - this works fine on an English OS (with English Acrobat). However, on a Japanese OS (with Japanese Acrobat), it fails - apparently, the name "Standard" is in Jap

  • OT: Monitor calibration with a gradient/varying values

    This is sort of off topic, but maybe someone knows. I bought a new LCD monitor which I thought was a reasonably decent quality. I did the regular Apple calibration. But the monitor clearly has more contrast at the top, and less at the bottom. I can s

  • Error loading weblogic.servlet.WlwJSPServlet

    Hello Has anyone encountered the following exception in workshop when adding a process or web project while the server is running. Exception:weblogic.management.ApplicationException: prepare failed for Untitled Module: Untitled Error: Could not load

  • Cannot detect Mighty mouse after waken from Sleep

    If i wake my book from sleep, the bluetooth app will not be able to detect the might mouse. And I also cannot switch off the blue tooth app at that time. I was trying to restart the bluetooth assistant but it fails. Any of you has such problem ?

  • Shockwave installed but not available in the Program Files list

    I have the latest version of this program successfully in my PC (Windows XP) but I can not associate a file extension supposed to be used with this program because the system does not find it and I can not find the access route to it.