How to bring a JFrame up maximized?

if you have a class like this:
public class myClass extends JFrame {
//some components
public myClass() {
//add some components
setVisible(true);
how can you make this JFrame to appear maximized?
SJG

There may be another way, but try this:
this.setSize(new Dimension((int)screenSize.getWidth(), (int)screenSize.getHeight() );

Similar Messages

  • How to bring to front created message dialog?

    Hello,
    I don't know if this is correct way to open popup window in JSF, but I do it like that:
    if (!((String)passwordField.getText()).equals(
    (String)confirmPasswordField.getText())) {
    javax.swing.JOptionPane infoDialog = new javax.swing.JOptionPane();
    infoDialog.grabFocus();
    infoDialog.showMessageDialog(new javax.swing.JFrame(),
    "Password and Confirm Password fields must be equal",
    "Information", javax.swing.JOptionPane.OK_OPTION);
    return null;
    Window is opening, but is covered under other windows, how to bring it to front?

    you mean I have to write a code in paintComponent()
    for painting the other one first, I write a seperate
    method to implement this functionNo, I mean just that. It's like drawing on a piece of paper. Paint one thing first, and the one that gets "on top" last. Save all your shapes in an array, paint them sequentially, and reorder the array as needed, if one should move from the background to the foreground.

  • How can i refresh JFrame at regular intervals to display in intervals

    I have a query which is :
    String query = "select FIRSTNAME, MIDDLEINITIAL, LASTNAME from user" ;
    now i have executed the above query
    ResultSet rs = stmt.executeQuery(query) ;
    Suppose i get 2000 rows in my resultset after execution.
    If i want to display all the contents of my query inside a JFrame, then i can say
    JFrame myFrame = new JFrame() ;
    myFrame.setSize(500, 500) ;
    while(rs.next()){
    add the results to myFrame
    myFrame.pack() ;
    myFrame.setVisible() ;
    but this may take a long time to show my frame, because first it has to either add components to my JFrame if use JLabels or if i use graphics then it has to wait till complete all of my drawString's to display the JFrame.
    and this may take time.
    I would like to know, how can make my JFrame intelligent enough so that if first display an empty frame, refresh at regular intervals and see how many i have fetched from the result set and add those to my JFrame, and do this opration untill i am done fetching all the results.
    Thanks
    Arun

    Any reason why you aren't displaying the results in a table? Both labels and drawString do not seem like a good alternative.
    Now to your question, you could use a thread and force painting after so many from the resultset. You could display a fixed number and implement your own scrolling scheme. Say paint first 50 and scrolling forward and back.

  • How to bring the data from application server to presentation server

    hi,
    i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this  topic.folowing is the code .
    *& Report  ZPFA_HIER_LOAD
    REPORT  ZFPA_HIER_LOAD.
    *---- Declaration of Oracle connectioN
    DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
    DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
    DATA : mfilename type string.
    data: begin of matab1 occurs 0,
          MFL1(9) TYPE C,
          MFL2(5) TYPE C,
          MFL3(9) TYPE C,
          MFL4(2) TYPE C,
          MFL5(8) TYPE C  ,
         end of matab1 .
    data: setid(8) type c.
    data: begin of source occurs 0,
          setid(8) type c,
          end of source.
    *PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
    *PARAMETERS : m_bsenty(8). " type c obligatory.
    *mfilename = P_PFILE.
    EXEC SQL.
      SET CONNECTION :con_name
    ENDEXEC.
    EXEC SQL.
      CONNECT TO :con_name
    ENDEXEC.
    EXEC SQL PERFORMING get_source.
      SELECT set_id FROM UNIT_SET INTO
      :setid
      ORDER BY SET_ID
    ENDEXEC.
    start-of-selection.
    LOOP AT SOURCE.
      REFRESH matab1. CLEAR matab1.
      EXEC SQL PERFORMING evaluate.
    SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
    :MFL5
    where set_id = :SOURCE-SETID ORDER BY MEM_ID
      ENDEXEC.
      if SOURCE-SETID = '80000000'.
       mfilename = '/tmp/aesorg'.
      elseif SOURCE-SETID = '80000006'.
       mfilename = '/tmp/Consolidation_Manager'.
      elseif SOURCE-SETID = '80000010'.
       mfilename = '/tmp/10org'.
      elseif SOURCE-SETID = '80000012'.
       mfilename = '/tmp/20org'.
      elseif SOURCE-SETID = '80000018'.
       mfilename = '/tmp/30org'.
      elseif SOURCE-SETID = '80000025'.
       mfilename = '/tmp/40org'.
      Endif.
      mfilename = '/usr/test.dat'.
    ************************This was i tried***********************
      open dataset mfilename for output in text mode encoding default." IN
    *TEXT MODE ENCODING DEFAULT.
    if sy-subrc <> 0.
    exit.
    endif.
    close dataset mfilename.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         FILENAME         = MFILENAME
         FILETYPE         = 'ASC'
       TABLES
         data_tab         = matab1
       EXCEPTIONS
         file_write_error = 1
         invalid_type     = 2
         no_authority     = 3
         unknown_error    = 4
         OTHERS           = 10.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
      clear matab1.
    ENDLOOP.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
    close dataset mfilename.
         MFL5 = '0'.
       CLEAR MFL5.
    FORM evaluate.
      if MFL5 = -1.
        MFL5 = ''.
      ENDIF.
      concatenate MFL1 ','   into MFL1.
      concatenate MFL1 ','   into MFL3.
      matab1-MFL1 = MFL1.
      matab1-MFL2 = 'ZBUE,'.
      matab1-MFL3 = MFL3.
      matab1-MFL4 = ' ,'.
      matab1-MFL5 = MFL5.
      append matab1 .
      CLEAR MFL1.
      CLEAR MFL2.
      CLEAR MFL3.
      CLEAR MFL4.
      CLEAR MFL5.
    ENDFORM.
                     "evaluate
    *&      Form  GET_SOURCE
          text
    FORM GET_SOURCE.
      source-setid = setid.
      append source.
      clear source.
    ENDFORM.                    "GET_SOURCE

    Hi Rammohan,
    You cannot use OPEN DATASET to transfer data from application server to presentation server.
    You can do the following :
    <b>Do 1st point in BACKGROUND</b>
    1. Read the data file from application server into an internal table using OPEN DATASET
    <b>Do 2nd point in Foreground</b>
    2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
    You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
    Best regards,
    Prashant

  • How to bring in the Open Sales Orders while performing Sales Order Conv

    Hi,
    Could you give some suggestions on the below:
    How to bring in the Open Sales Orders while performing Sales Order Conversion in R12.
    Thanks
    Pravin

    See http://ramugvs.wordpress.com/2011/08/27/how-to-stage-and-import-an-order-using-order-import-api-apps-wms-ebiz-11i-r12/
    Sandeep Gandhi

  • How to bring all columns in a single/first page in report painter

    Hi Experts,
    There are 9 columns in a report painter which includes 1 lead column.
    7 columns comes in a first page including lead column and rest 2 columns goes to second page. This report is copied from another report where all columns comes in a first page only. if the original report comes in one page then why not the new report.
    Please suggest how to bring all columns in a single/first page in the new report.
    Please revert if I'm confused anywhere.
    Thanks in advance
    Arabinda

    Hi Rajneesh,
    Thanx for the quick reply. When I change the column width to 10 it comes in one page. But the requirement is to keep the column width to at least 12 or 14 and moreever the original report from where this report is copied having the same no of columns and the column width for original report is 14 and it comes in one page only.
    Do I need to do something more to achieve this. My question is how the original reports data comes in one page where as the current report having issue with same number of columns.
    Pls suggest.
    Thanx,
    Arabinda

  • How to bring the Header value to the row ?

    Dear All,
    I am a starter in learning SDK. have developed a form having 2 tables a header and a row detailed one.
    Now i need to update a field in all the row with a header value when the header value is added. it should be like the SE name getting updated when the SE name is selected in header level in std doc.
    how to arrive it?
    kindly help me to achieve this.
    Thanks,
    Sam.

    Dear Gordon,
    May the customer enters a value to the header which they want it to be unique value for all the row detail.
    If there exists more than 50 rows they cant enter it for each and every row, for in case if the value needed to be changed for a particular row or for particular few rows they will change it manually to that row alone.
    I just want to achieve this scenario in my form.
    Do you know how to bring in ?
    As this is being a normal functionality in Std forms.
    Thank you...

  • How to bring cursor in Table control??

    Hi to all
    How to bring cursor in Table control when entering into screen
    can anyone tell me??? pls explain with example..
    thanks
    senthil

    Hi,
    Check the below code
    data l_tc_name             like feld-name.
    data l_tc_field_name       like feld-name.
    get actual tc and column                            
      get cursor field l_tc_field_name
                 area  l_tc_name.
    Regards,
    Vind

  • Have been using Foxfire for AMcG website. Now want to edit MME website. Can't figure out how to bring up second website. Whatever I do, it keeps taking me ba

    Have been using Foxfire for AMcG website. Now want to edit MME website. Can't figure out how to bring up second website. Whatever I do, it keeps taking me back to the original AMcG site.
    Because I'm unable to figure out where to find the answer to this question on this website, would you mind emailing it to <sub>removed by a moderator -j99</sub>. Much obliged, for I'm working on a tight deadline and have no one else to turn to, being it's Sunday.
    Please note this is a publicly available and web search indexed forum that the message appears on https://support.mozilla.org/en-US/questions/950640 you probably do not wish your email address to appear. Note it is possible to use the private messaging ssytem without disclosing your email address
    [https://support.mozilla.org/en-US/messages/new?to=John99 me] [https://support.mozilla.org/en-US/messages/new?to=annmcgill you]

    Sorry I not sure I understand what you are trying to do and what the problem is, are you able to give more details please.
    Are you trying to upload to a site you own ?

  • BI 7.0: How to bring DataSource fields to InfoSource in design

    We've replicated the generic datasource from R3 to BW and we have created an InfoSource with blank fields.   We remember on BW 3.x version that we could bring Datasource fields to InfoSource by clicking somewhere, but on BI 7.0, we are trying to do the same thing, but can't find some function to do this.  Then we try to right click the InfoSource and then select 'Create Transformation', and then to select the source system and the datasource, but of course we would get the error msg like "There are no fields in target TRCS InfoSource_Technical_Name".  Any idea on how to bring Datasource fields into the blank InfoSource on BI 7.0?
    Thanks!

    Hi,
    Instead of bringing the DS fields into a blank infosource, ideally, what you can do
    is, you can create a new infosource based on your generic data source, which would make your process easy..
    cheers,
    Pattan.

  • In PO how to bring default tick in info update?

    In PO how to bring default tick in info update? Please explain me very clear. I know the transaction OMFI is using. I need how to assign with parameter ID? Please be clear?

    Hi,
    Go to SU01, here enter the User ID and click on "Change" button
    Here in "Parameters" Tab, maintain the value for e.g. 01 or 02 (which ever key you are using) against Parameter ID EVO and save.

  • I change my apple ID and password like a week now and after changing all my information and MY apple ID, i noticed that i lost all my picture in my camer roll and my photo stream too ;(.. Can anyone please help me how to bring it back all my photos?

    I change my apple ID and password like a week now and after changing all my information and MY apple ID, i noticed that i lost all my picture in my camer roll and my photo stream too ;(.. Can anyone please help me how to bring it back all my photos?

    I don't know about your camera roll, but for photostream just do this:
    Go into Settings > iCloud > Delete Account and then sign back in using your Apple ID information.
    Make sure to do the same thing with your iTunes and App Store options.
    Settings > iTunes and App Store > Click Email and sign out, then sign back in.

  • How to place the JFrame in center of the screen

    Hi.. please any one tell me how to place the jframe in the center of the screen.. i am working on windows.
    setLocationByPlotform is not working...

    //GETS SCREEN SIZE
            Dimension screen_Dimension =Toolkit.getDefaultToolkit ().getScreenSize ();
            //GETS WINDOWS SIZE
            Dimension frame_Dimension = window.getSize ();
            //PUTS FRAME IN THE "MIDDLE" OF THE SCREEN
            window.setLocation ( new Point (
                    (screen_Dimension.width / 2-frame_Dimension.width / 2),
                    (screen_Dimension.height / 2-frame_Dimension.height/ 2)));Not sure if you want the raw version of it.......

  • How to bring the hyperlink in a JLabel object ?

    How to bring the hyperlink in a JLabel object ?
    I tried the following--> [ this is a sample ]
    JLabel label;
    label=new JLabel("<HTML><A HREF='file://D:/Examination/calc.exe'>Calculator</A></HTML>");Using this JLabel object in an JDialog the label comes perfectly with such a look of the hyperlink
    [ Blue coloured and underlined ] that's all !!
    It doesn't work anything that it should do.
    While all the html tags work perfectly in java then why the hyperlink in label doesn't ?
    If you have an idea then please send me the code.
    Thanks!

    see JXHyperLink at https://swingx.dev.java.net/
    Yeah, I looked at this. I agree with the other guy who said that all this does, presumably, is change the color of the text when the button is getting mousedover. That doesn't solve anything.
    As far as JEditorPane, it has its bad points and ... well, mostly bad points. However that's not really fair. JEditorPane was not designed to be on the level of an IE or FireFox.
    The BEST thing to use JEditor's web browsing facilities on is for creating your own documentation and help pages for software you are developing. Here is a list of some of the things JEditorPane does not come equiped with (as of 1.4 I haven't tried playing with it in 1.5):
    1. Form submission, PUT, and GET
    2. Download status
    3. Caching
    4. Cookies
    5. Plugins (ie Java, Flash, Quicktime)
    6. No javascript.
    Beyond that it is extremely brittle in parsing the HTML, and if the HTML is not totally well formed (and many pages are not) you won't get anything

  • My MacBook Pro won't go beyond a white screen, after I pushed the restart button. How can I get it to a login? I have routinely backed it up, but don't know how to bring that up, nor if I have a boot file on that external disk. Help!

    My MacBook Pro won't go beyond a white screen, after I pushed the restart button. How can I get it to a login? I have routinely backed it up, but don't know how to bring that up, nor if I have a boot file on that external disk. Help!

    Take each of these steps that you haven't already tried. Stop when the problem is resolved.
    To restart an unresponsive computer, press and hold the power button for a few seconds until the power shuts off, then release, wait a few more seconds, and press it again briefly.
    Step 1
    The first step in dealing with a startup failure is to secure the data. If you want to preserve the contents of the startup drive, and you don't already have at least one current backup, you must try to back up now, before you do anything else. It may or may not be possible. If you don't care about the data that has changed since the last backup, you can skip this step.
    There are several ways to back up a Mac that is unable to start. You need an external hard drive to hold the backup data.
    a. Start up from the Recovery partition, or from a local Time Machine backup volume (option key at startup.) When the OS X Utilities screen appears, launch Disk Utility and follow the instructions in this support article, under “Instructions for backing up to an external hard disk via Disk Utility.” The article refers to starting up from a DVD, but the procedure in Recovery mode is the same. You don't need a DVD if you're running OS X 10.7 or later.
    b. If Step 1a fails because of disk errors, and no other Mac is available, then you may be able to salvage some of your files by copying them in the Finder. If you already have an external drive with OS X installed, start up from it. Otherwise, if you have Internet access, follow the instructions on this page to prepare the external drive and install OS X on it. You'll use the Recovery installer, rather than downloading it from the App Store.
    c. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, start the non-working Mac in target disk mode. Use the working Mac to copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
    d. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.
    Step 2
    If the startup process stops at a blank gray screen with no Apple logo or spinning "daisy wheel," then the startup volume may be full. If you had previously seen warnings of low disk space, this is almost certainly the case. You might be able to start up in safe mode even though you can't start up normally. Otherwise, start up from an external drive, or else use the technique in Step 1b, 1c, or 1d to mount the internal drive and delete some files. According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation.
    Step 3
    Sometimes a startup failure can be resolved by resetting the NVRAM.
    Step 4
    If a desktop Mac hangs at a plain gray screen with a movable cursor, the keyboard may not be recognized. Press and hold the button on the side of an Apple wireless keyboard to make it discoverable. If need be, replace or recharge the batteries. If you're using a USB keyboard connected to a hub, connect it to a built-in port.
    Step 5
    If there's a built-in optical drive, a disc may be stuck in it. Follow these instructions to eject it.
    Step 6
    Press and hold the power button until the power shuts off. Disconnect all wired peripherals except those needed to start up, and remove all aftermarket expansion cards. Use a different keyboard and/or mouse, if those devices are wired. If you can start up now, one of the devices you disconnected, or a combination of them, is causing the problem. Finding out which one is a process of elimination.
    Step 7
    If you've started from an external storage device, make sure that the internal startup volume is selected in the Startup Disk pane of System Preferences.
    Start up in safe mode. Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Post for further instructions.
    Safe mode is much slower to start and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know the login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    When you start up in safe mode, it's normal to see a dark gray progress bar on a light gray background. If the progress bar gets stuck for more than a few minutes, or if the system shuts down automatically while the progress bar is displayed, the startup volume is corrupt and the drive is probably malfunctioning. In that case, go to Step 11. If you ever have another problem with the drive, replace it immediately.
    If you can start and log in in safe mode, empty the Trash, and then open the Finder Info window on the startup volume ("Macintosh HD," unless you gave it a different name.) Check that you have at least 9 GB of available space, as shown in the window. If you don't, copy as many files as necessary to another volume (not another folder on the same volume) and delete the originals. Deletion isn't complete until you empty the Trash again. Do this until the available space is more than 9 GB. Then restart as usual (i.e., not in safe mode.)
    If the startup process hangs again, the problem is likely caused by a third-party system modification that you installed. Post for further instructions.
    Step 8
    Launch Disk Utility in Recovery mode (see Step 1.) Select the startup volume, then run Repair Disk. If any problems are found, repeat until clear. If Disk Utility reports that the volume can't be repaired, the drive has malfunctioned and should be replaced. You might choose to tolerate one such malfunction in the life of the drive. In that case, erase the volume and restore from a backup. If the same thing ever happens again, replace the drive immediately.
    This is one of the rare situations in which you should also run Repair Permissions, ignoring the false warnings it may produce. Look for the line "Permissions repair complete" at the end of the output. Then restart as usual.
    Step 9
    If the startup device is an aftermarket SSD, it may need a firmware update and/or a forced "garbage collection." Instructions for doing this with a Crucial-branded SSD were posted here. Some of those instructions may apply to other brands of SSD, but you should check with the vendor's tech support.  
    Step 10
    Reinstall the OS. If the Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade.
    Step 11
    Do as in Step 9, but this time erase the startup volume in Disk Utility before installing. The system should automatically restart into the Setup Assistant. Follow the prompts to transfer the data from a Time Machine or other backup.
    Step 12
    This step applies only to models that have a logic-board ("PRAM") battery: all Mac Pro's and some others (not current models.) Both desktop and portable Macs used to have such a battery. The logic-board battery, if there is one, is separate from the main battery of a portable. A dead logic-board battery can cause a startup failure. Typically the failure will be preceded by loss of the settings for the startup disk and system clock. See the user manual for replacement instructions. You may have to take the machine to a service provider to have the battery replaced.
    Step 13
    If you get this far, you're probably dealing with a hardware fault. Make a "Genius" appointment at an Apple Store, or go to another authorized service provider.

Maybe you are looking for

  • Original iPhone, latest firmware, universal dock, composite AV cable ...

    and a plasma tv... I am trying to watch some ITunes U movies on my plasma set while working out. So i buy a universal dock, the composite AV cable for the iPhone, hook it all up and try to watch an episode. What happens is that the video on the iPhon

  • Mac Mini 2014 with Apple bluetooth keyboard and Magic Mouse

    Hi all, I'm currently in the process of moving from my old MacBook to a Mac Mini 2014 and I have a couple of questions regarding functionality of the Apple bluetooth keyboard and Magic Mouse with the Mac Mini. As these are the only keyboard and mouse

  • IPhoto 08 makes it difficult to print greeting cards

    It seems to me that it should be easier to print greeting cards yourself from iPhoto. I have tried many ways and there are no options to adjust the print size. No one makes paper the correct size, and printing on a Letter sized page doesn't work. In

  • Is it possible to change or cancel the initial gre...

    I have recently bought an N95-8GB and so far I like it very much. However, one thing I dislike is the initial greeting after starting the phone, the one with the two handshaking hands. Is it possible to cancel this greeting, or replace it with a blan

  • Problem of percentage with calculated KF

    Hi, I am trying to get the percentage share of a calculated KF. its something like this col -> RKF1  RKF2 CKF(RKF1 + RKF 2) row1:392150 0  392150 row2:410925 101298  512223 %(row1%A row2): 95% --  95% The last % value should be 76% but it doesn;t tak