Can't change Canvas's Maximum Size

Hi, I am trying to make a program which has a frame which is fullscreen and a canvas which is the same size.
So far I have got this:
JFrame frame = new JFrame("Screensaver");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Toolkit tk = Toolkit.getDefaultToolkit(); 
screenWidth = ((int) tk.getScreenSize().getWidth()); 
screenHeight = ((int) tk.getScreenSize().getHeight()); 
frame.setSize(screenWidth, screenHeight); 
frame.setUndecorated(true);
frame.setResizable(false);
Canvas canvas = new Canvas();
Dimension screenSize = new Dimension(screenWidth, screenHeight);
canvas.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { System.exit(0); } });
frame.getContentPane().add(canvas, BorderLayout.CENTER);          
frame.setVisible(true);
canvas.setMaximumSize(screenSize);
canvas.setSize(screenSize);Note: At the beginning of the class is:
public int screenWidth.;
public int screenHeight;But the canvas still won't draw larger than the default maximumSize.
As soon as I change the maximumSize, and then look at it again, it's gone back to the default!
Anyone have any idea why?

Do you want a [full screen exlcusive|http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html] window or just a window that happens to be the size of the desktop (minus the area of the taskbar)?
But the canvas still won't draw larger than the default maximumSize.I'm not sure how to interpret this statement. You've set the maximum size to the the desktop. So are you saying you can't draw beyond the desktop? Are you using canvas.getGraphics() by any chance?
As soon as I change the maximumSize, and then look at it again, it's gone back to the default!The canvas is added to the content pane in the BorderLayout.CENTER region. And it's the only component in there. Hence, it will be the same size as the content pane (which is the same size as the frame) regardless of what size or preferred size you may set on it. This is to be expected though. BorderLayout is allowed to resize the center component to take up the extra space.

Similar Messages

  • FAQ: UI - How can I change the color theme, size of the text, or turn off the application frame?

    CHANGING THE INTERFACE COLOR SCHEME:
    The Photoshop CS6 default interface is dark, but if you prefer the lighter interface you are used to from earlier versions,
    you can change it back in the appearance area. There are 4 default color themes.
    Mac          Photoshop > Preferences > Interface
    Windows   Edit > Preferences > Interface
    CONFIGURING LARGER FONTS:
    For those who need larger fonts, you can also change the UI Font Size down in the type area.
    Be sure to restart Photoshop to see the changes.
    TURNING OFF THE APPLICATION FRAME
    CS6 opens now by default in "Application Frame". You can go Window>Application Frame in the main meu and uncheck this

    Select the title / text and then click on the "i" (inspector). A colored pin wheel shows up after you click on the square box directly below the font settings inside the inspector window. Then simply drag the dot to the color you want. Like this:
    click here
    Message was edited by: SDMacuser

  • How can i change the position and size of the applet

    dear fellows,
    how can i change the position and size of the applet in which form is running over the web.
    thanx
    Mochoo

    Yes, you can add the following line to your formsweb.cfg section :
    HTMLbodyAttrs=onLoad='javascript:self.moveTo(100,100)'
    if you are in SEPERATEFRAME = FALSE
    Or Set_Window_Property( FORMS_MDI_WINDOW, POSITION, X, Y ) ;
    if you are in SEPERATEFRAME = TRUE

  • Can we change the initial extent size of tablespaces

    Hi All,
    Can we change the initial extent size of tablespaces.
    Oracle version-11.2.0.1
    OS - IBM AIX
    Please suggest.
    Thanks and Regards,

    There is no way to redefine the initial extent but by dropping/recreating it. But you can try to deallocate the unused space beyond the High Water Mark (alter table table_name deallocate unused keep 0;), as shown on the next demo:
    Madrid @ Re: Resizing initial extent
    Regards
    Girish Sharma

  • How can I change the default page size for the Adobe PDF Printer?

    Hello All,
    I have cases where I need to switch the default paper size from 8.5x11 to 11x17 via api for the Adobe PDF Printer and have not been able to find how this can be accomplished.
    I am using C# .Net and would appreciate any help.
    Thanks in advance,
    Bob

    There is no Acrobat API for this, but so far as I know there doesn't need to be. The user can go change this from the Printers Control panel as needed. The Adobe PDF printer has some differences from regular printer drivers, but this isn't one of them.

  • How can I change the color and size of the freehand tool in Adobe Reader on the IPAD?

    How can I change the size and color of the freehand tool in Adobe Reader for IPAD?

    One more step I didn't mention. After making your freehand drawing, you need to click Save (upper right) to let Reader know you're finished drawing. Then click on it, and the contextual menu will look like this:

  • Can you change flash player window size for a published Captivate course?

    I am working on publishing a course with a FMR and, during testing, a lot of scrolling was required so I wanted to resize the window.  Is this possible and, if so, how do I do it? Similar to Flash where you can publish to dimension %???

    you can adjust the movie size in the html, with varying levels of success based on how much you scale.
    edit the swf associated .htm file with a text editor and look for this line:  var so = new SWFObject("project_name.swf", "Captivate", "641", "516", "10", "#CCCCCC");  In this case the 641 and 516 are the pixel dimensions.  you can also change it to a %
    I've never done it with FMR so I won't attest to how well it'll work.

  • Can you change the TOC font size and pane size?

    I am using RH 9 to generate WebHelp whose output is ultimately being viewed by a QT browser on a Linux platform machine. In my WebHelp settings, I am using "(Traditional style -no skin)" and using "Show/hide navigation pane" in my topic navigation.
    Because of the small size screen that it is being viewed on, the default TOC pane size is too big (takes up half the screen), and the TOC font is too small (defaults to 10 pt). I can't seem to find any where in the RH UI to change these two settings. Does anyone know the specific output file(s) where these are being stored so can I change these settings manually? I know that if I manually change them outside of RH, I'll need to do it every time file I publish my help system, but that's an acceptable workaround to me, given the importance of this issue to me.

    Hi Steve
    Sounds like you missed seeing this link on the page where you downloaded it from:
    Click image below for larger and clearer view
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Can't change the font, color, size, text style, or alignment in iMovie 09..

    Hi there
    Just startet editing an mp4 file. I'm trying to do subtitles, and the only suitable option is the "Lower Third' titling option. According to the Help file "Select the title in the Project Browser, and then click Show Fonts in the viewer. The iMovie Font Panel opens." Well, it doesn't. 'Show Fonts' just disappears....am I missing something?
    Thanks in advance.

    I found out that you have to choose font, style & pt. size BEFORE you start typing your title, which is lame. If you type your title, you can't change the font etc. afterwards—you have to delete the title and start again. Very annoying, and, for Apple, a surprising bug.

  • ITunes U can not change the video view size to 1x

    After updating to iOS 6, I realised that the iTunes U video play can only display the maximal size view which makes the video quality very poor and there isn't any way for to change the video to 1x size. I wonder if anyone has found a solution for this issue yet. Thank you and look forward to hearing answers about this issue.

    OzziesMAC wrote:
    Is it possible on iTunes to select a different frame?
    Yes it is.  See this:  iTunes: How to set the poster frame of movies, http://support.apple.com/kb/TA23881

  • Can I change the overall text size for the app interface...NOT the titler

    How can I increse the font size globally for all panels?? I need to make it larger I have looked for the answer, is there one...Coming from FCP which is easily changed, please help these old eyes! Thanks   CS5 on a Mac

    As time goes on, PP might just have all the things I love about FCP along with all the things I love about PP..... I hope Apple(they probably never come here) would take note of the steps Adobe take to listen to their customers. The one other thing I noticed is that premier's time indicator moves way too sensitively even when snapping is selected. They might wanna.............................they might wanna make it so i can right-click and send to a feature request form. I'm getting tired of opening that page. Never the less submitted.

  • How can I change the default window size of a new message permanently?

    The mail window opens up very small and every time I must increase the size manually. I want to be able to set it so it opens larger or at least opens to the saem size as a previous mail window, which is what Mail used to do.
    Also, can anyone tell me how to stop that new mail window from opening on the bottom left of my screen? I need to move it in orde to increase the window size. So, 2 default actions that are a psin to constantly deal with.
    Is there any guru out there who has had this problem and solved it? Thanks!

    http://kb.mozillazine.org/Font_settings_in_Thunderbird

  • Can I change the default page size for SYSBUILD?

    When I start SYSBUILD it always has a default page size of Letter set, is there any way to change this as most of the blocks I wish to print are to be printed on A3 paper?
    Many thanks
    Tim

    Hi Tim,
    Unfortunately there is no option to change the default print settings for SystemBuild. You must manually select the A3 paper size under File>>Page Setup.
    Thanks for the suggestion though, I will pass that on to R&D as a product suggestion for a future release.
    Regards,
    Jeff M.
    Applications Engineering
    National Instruments

  • How  can I change the displayed video size in the Clearbox Lightbox widget?

    Hi Everyone,
                           This is what I'm working on:
    http://www.artbywaqas.com/STORYBOARDS.html
    http://www.artbywaqas.com/DEMOREEL.html
    The videos are actually bigger but they show up really small in the browser window. How can I fix this?
    The other section are not up yet.

    To what size from what template?
    A business card is basically just a rectangle so just make one the right size, clear the rest and option drag out copies of yours to the other positions. You will need to move the crop marks as well.
    Peter

  • Can I change the default text sizes in the Character Menu?

    At my last job I used a program called Creator to create the projects for which I now use InDesign.  In Creator there was a section in the Preferences that allowed you to specify what font sizes were in the drop down menu, but I don't see such a setting in InDesign.  Its not a huge deal, but its nice to have, say 20pt in your drop down menu as a type size if you use that particular size a lot, as opposed to typing it in every time.  Does anyone know if there is a way to do this?  Thanks!!

    Thanks Bob, I didn't think of that, I suppose that would work.  Basically I would just like to have more text sizes to choose from in the drop down menu, I guess its more an issue of laziness on my part than anything else.  I could make a character style for it, but then I'd probably have 10 different character styles just to change the size of my text when it would be less hassle just to type in the size I need.  I was just looking for a quick fix default option that I was used to having at my old job.

Maybe you are looking for

  • Budget to Actual Variance Formula in Scenario Dimension help

    I am trying to calculate the Budget to Actual variance by using a member formula in the Scenario dimension. The formula I'm using is: @VAR("Final"->"Actual" -> &CurrentYear,"Budget"); This formula yields a value that equals the budgeted amount. The V

  • Selecting using a field that stores a column_name to be used in the where

    I have a table REPORTING_CRITERIA with fields and field values: gl_criteria1 = 'cc.segment5' from_value1= '1123' to_value1= '1130' gl_criteria2 = 'cc.segment5' from_value2 = '1140' to_value2 = '1150' I am trying to run a select where I pull records w

  • How can I get the selected action of content type by javascript from Firefox Options Applications?

    I works on my website, and it have to check the PDF file will be opened in which plugins So we have to implement some javascript to check the selected action of Content Type from Tool>Options>Application Do we have any javascript code to check this

  • How to unluck iphone with a passlock?

    how to unlock an iphone 4s? the person who gave this phone to me forgot the passcode. i couldn't use it. can some one help me to unlock or any suggestion on what to do with this iphone. thanks.

  • Help with ati Radeon HD 3650

    Hi, I've got a relatively new system with a fresh install of arch on it, and I'd like to get some fancy desktop effects going like the one in this video:http://www.metacafe.com/watch/1927392/a … her_stuff/. The videocard I've got is a radeon hd 3650,