Empty space FlowLayout

In the program to the end, I get a window and empty space in the upper window frame and number in the box above. Is someone can you please help me get rid of this empty space? In other words, how can I move the highest number a bit?
import java.awt.*;
import javax.swing.*; 

public class ShowTime extends JFrame
{
    public static void main(String[] arguments) {
        ShowTime frame = new ShowTime();
        frame.pack();
        frame.setVisible(true);
    }

    JLabel lTime;
    public ShowTime() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        JPanel pane = new JPanel();
        pane.setLayout(new FlowLayout());
        
        lTime = new JLabel("88:88");
        lTime.setFont(new Font ("Helvetica", Font.PLAIN, 88));
        pane.add(lTime);
        setContentPane(pane);
    }
}

The space belongs to the default size of the label. I'm not why there is so much space above the text. You can see this by adding a border to the label:

lTime.setBorder( new javax.swing.border.LineBorder(Color.RED) );

If you really want to get rid of the extra space, you can manipulate the default with something like:

lTime.setFont(new Font ("Helvetica", Font.PLAIN, 88));
FontMetrics fm = lTime.getFontMetrics( lTime.getFont() );
TextLayout layout = new TextLayout(lTime.getText(), lTime.getFont(), fm.getFontRenderContext());
Rectangle2D bounds = layout.getBounds();
Dimension d = lTime.getPreferredSize();
d.height = (int)(bounds.getHeight() + 1);
lTime.setPreferredSize( d );

Tags: Java

Similar Questions

  • Empty space above the address bar in mode full screen on Mac.

    Hello.
    Empty space appears above the address mode bar full screen when I bookmark specific web page for the first time after the start of FF. Is the path to hide this space view-> toolbars-> customize-> fact. But it appears each time after restarting FF. All the addons disabled does not help. This problem disappears only in FF safe mode.

    Thank you
    Roman

    Exit Firefox completely and profile folder delete localstore.rdf in case you have the file corrupt localstore.rdf .

  • I make the school, searching for words in the empty spaces, and something began to offer me words when I start typing. I don't want to!

    To my school work, type the words into the empty spaces to practice typing and spelling correctly. When we submit every page, the system ranks for us. The words are there on the page. I did this on Firefox since March, but I got a new computer for a few days now. I don't know if it's a Firefox, Windows or computer problem. When I start typing a few words into the empty spaces, all of a sudden a small window appears, with a word in it, as if to show me what it should be. Are the words that I was seized in this school work, but they are not what I want and I don't want this feature. It is annoying and does help me to learn the words. (for example, I typed 'v' at the beginning of "viscous" and was offered "visceral".) I typed 't' of tachypnea, was offered 'superior', 'triamcinolone' and 'cones '. When I continued, 'your', I was offered 'parietal '! "These are all words, I typed in my curriculum in the last day or two). It started just happening tonight. Where it comes from and how can I make it disappear?

    • Click on the (empty) input field on the web page to open the drop-down list
    • Select an entry in the drop-down list
    • Press the DELETE key (on a Mac: shift + delete) to remove it.
  • I have an Apple Mac computer (about 2 years) and on many occasions I tried to install Service Pack 3 and every time it does not have enough space whne the system has a large empty space

    I have an Apple Mac computer (about 2 years) and on many occasions I tried to install Service Pack 3 and every time it does not have enough space whne the system has a large empty space

    Error message when you try to install XP Service Pack 3 on some Intel processor Apple computers, 'more space':

    http://support.Microsoft.com/kb/950716 MS - MVP - Elephant Boy computers - don't panic!

  • My taskbar is suddenly vertically on the right side of my screen instead of at the bottom. (default) Ive tried to bring it back to its original spot by clicking and now an empty space, but cannot get a reaction. How can I get that back to the default?

    My taskbar is suddenly vertically on the right side of my screen instead of at the bottom. (default) Ive tried to bring it back to its original spot by clicking and now an empty space, but cannot get a reaction. How can I get that back to the default?

    Right-click on the taskbar and make sure the taskbar are not locked. Then move it using the left mouse button. Microsoft® Security MVP, 2004-2009

  • active task bar has an empty space between two icons

    Why my Active taskbar has an empty space where the icon should be, but there is none.

    It shows the applications running, but between two of them, there is a space for one, but he's not here.

    As if it were invisible... nothing to do with the button "see the hidden icons.

    This is the way it shows:

    from right to left: clock, volume, network connection icon icon, icon options power, BLANK, anti virus, the webcam icon and so on

    Hello

    ·         Are you referring to the system tray?

    ·         Did you the latest changes on the computer before the show?

    Method 1:

    I suggest you to refer to this article and check if it helps.

    Remove icons from the notification area (system tray)

    http://Windows.Microsoft.com/en-us/Windows-Vista/remove-icons-from-the-notification-area-system-tray

    Method 2:

    If the problem persists I suggest you perform the clean boot on the computer and check if it helps.

     

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135/en-us

    Note: Don't forget to start the computer in normal mode by following step 7 from the link.

  • How do for remote empty space

    I have an edit box that can contain 5-digit

    If I apply the space he has to take the entered digits, leaving the empty space

    How to do

    1_3_5

    How to get 135

    Thank you

    net.rim.device.api.util.StringUtilities

    Number of strings = StringUtilities. removeChars (editbox.getText (),"" ");

    If you need whole parseit

    int no = Integer.parseInt (number);

     

  • Exit SQL includes a lot of empty space - can I get rid of him?

    I have a simple piece of SQL running in an Oracle EBS table:

    SET LINESIZE 1000
    SPOOL c:\temp\oracle\test.txt
    SET TRIMSPOOL ON
    SET TRIMOUT ON
    SELECT TRIM(fu.user_name) user_name
         , TRIM(fu.user_id) user_id
         , TRIM(fu.description) description
         , TRIM(fu.email_address) email_address
         , TRIM(fu.fax) fax
         , TRIM(fu.person_party_id) person_party_id
      FROM applsys.fnd_user fu
     WHERE user_name = 'ZZZAAAB';
    SPOOL OFF
    

    The info for the selected fields:

     Name              Null?    Type
     ----------------- -------- ----------------------------
     USER_ID           NOT NULL NUMBER(15)
     USER_NAME         NOT NULL VARCHAR2(100)
     DESCRIPTION                VARCHAR2(240)
     EMAIL_ADDRESS              VARCHAR2(240)
     FAX                        VARCHAR2(80)
     PERSON_PARTY_ID            NUMBER
    

    When I look at the content of "test.txt", they appear as follows:

    USER_NAME                                                                                            USER_ID                                  DESCRIPTION                                                                                                                                                                                                                                      EMAIL_ADDRESS                                                                                                                                                                                                                                    FAX                                                                              PERSON_PARTY_ID                         
    ---------------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- ----------------------------------------
    ZZZAAABB                                                                                             12345                                    Joseph Bloggs                                                                                                                                                                                                                                    [email protected]                                                                                                                                                                                                                 June 15 rev:SEPT REV 051214; jun15 rev                                           11144455                                
    1 row selected.
    

    There is a huge amount of fill / empty space between fields and the total width of the data is 746 characters. I tried TRIM, TRIMOUT and TRIMSPOOL, but none makes no difference.

    I tried a LINESIZE over small example 700, but data encapsulates then as follows:

    USER_NAME                                                                                            USER_ID                                  DESCRIPTION                                                                                                                                                                                                                                      EMAIL_ADDRESS                                                                                                                                                                                                                                   
    ---------------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FAX                                                                              PERSON_PARTY_ID                         
    -------------------------------------------------------------------------------- ----------------------------------------
    ZZZAAABB                                                                                             12345                                    Joseph Bloggs                                                                                                                                                                                                                                    [email protected]                                                                                                                                                                                                                  
    June 15 rev:SEPT REV 051214; jun15 rev                                           11144455
    1 row selected.
    

    If I use dummy data, the result is nice and compact:

    SET LINESIZE 200
    
    with tbl_data AS
    (SELECT 'ZZZAAAB' user_name
          , 12345 user_id
          , 'Joseph Bloggs' description
          , '[email protected]' email_address
          , 'June 15 rev:SEPT REV 051214; jun15 rev' fax
          , 77778899 person_party_id FROM DUAL)
    SELECT * FROM tbl_data;
    
    USER_NAME    USER_ID DESCRIPTION   EMAIL_ADDRESS                    FAX                                    PERSON_PARTY_ID
    --------- ---------- ------------- -------------------------------- -------------------------------------- ---------------
    ZZZAAAB        12345 Joseph Bloggs [email protected] June 15 rev:SEPT REV 051214; jun15 rev        77778899
    1 row selected.
    

    I can't get around the selection of data from tables, thanks to the design of the table?

    Hello

    You need to change the columns for output. For example:

    User_name FORMAT A20 COLUMN

    COLUMN user_id FORMAT 9999999999

    ....

  • Remove the empty spaces and LF between lines in xml

    Is there a way to remove the empty spaces and LF between XML nodes?

    Let's say I

    CLOB l_clob;

    ..

    l_clob: ='

    < root >

    < name > ioerio < / name >

    < 10 > < / age >

    < / root >

    ';

    I need to get a XML in a single line without spaces and withoud LF...

    Example:

    SQL > ed
    A written file afiedt.buf

    1 declare
    2 l_clob clob.
    3. start
    4 l_clob: ='
    5
    6 ioerio
    7    10
    8

    9  ';
    10 l_clob:=replace(l_clob,chr(10)); -Remove line breaks
    11 l_clob: = regexp_replace (l_clob, ' > +)<','><>
    12 dbms_output.put_line (l_clob);
    13 * end;
    SQL > /.
    ioerio 10

    Must say, this is a strange requirement.  Most people ask how to do the reverse.

  • empty space above the video tracks in the sequence window

    Hi, I like to use Premiere Pro, but like almost everyone else I have irritating things during use. When I resize the window of the sequence trying to see all the tracks video and audi, I get this empty space above my video tracks. Could not find the option to delete this. The button on the right bars only I have bigger or smaller individual tracks. I have attached a screenshot to make it clear. I hope someone can help me with something boring... Regards, René

    2016-05-05_11h40_20.jpg

  • How can I make my mobile site fill the whole browser. I have a big empty space to the right.

    When I write my site there is a large empty space on the right. How to make my page fill the entire screen?

    This happens usually when you have one or more items or extending outside the area of the layout or phone page breakpoint. Move or resize the elements to the page area or a breakpoint can solve the problem.

    If will be able to help better if you could share the URL of the site in question and also let us know if you create a breakpoint for your phone or a separate provision of the phone?

    Kind regards

    Vivek

  • Empty space that surrounds a layer by using the transform tool

    Hello, I met a strange thing in Photoshop, which is probably start my fault, but I am struggling to find a solution. Basically, I have a layer, and when I want to convert/resize, there, there is always a box with an empty space around him. I tried a lot of things trying to get rid of the box and just being able to select directly around the object in the layer, but not luck.

    Someone at - it solutions?

    Thank you

    Screen Shot 2016-03-23 at 22.28.16.png

    That is to say that the layer contained out in regards to the handles.  There is no need to be a single pixel to 1% opacity, and free transform it will include.  The solution is to make a loose selection around the central object > reverse selection > and delete.

  • When you export .mp4, often has "audio ghost" of the clip before repeating in the empty space on the sequence

    When I export a (h264) .mp4 in the sequence (using the encoder) I often get a video that has the sound that repeats.  (that is to say: 'what is that?', 'what is that?","what's that?")  I think it is especially when there is empty space on the sequence between the clips.  Does anyone else have this problem?  Try to clean the media Cache, hoping that this will solve it... taking a lot of time out of the edition actually.  Adobe, fix!

    (Running the latest Premiere Pro CC 2015 on iMac, Yosemite)

    I just did a quick test. I uninstalled Media Encoder and reinstalled for the most up-to-date version, 2015.1 CC. Then I re-exported a portion of my order which showed this problem audio ghosting. Voila! More no audio duplication.

    Incredibly grateful that it was as simple as that... Phew!

  • understand an empty space

    The error:

    Error occurred while processing request

    Invalid list index 16.

    In the function ListGetAt (list, index [, delimiters]), the index value, 16, is not valid as the first argument (this list has 15 items). Valid indexes are between 1 and the number of elements in the list.
    The error occurred in D:/home/manpcs.com/wwwroot/Untitled_cfm.cfm: line 52
    50 :           '#replace(listGetAt(i,14,chr(9)),'"','','all')#', 51 :           '#replace(listGetAt(i,15,chr(9)),'"','','all')#', 52 : '#replace(listGetAt(i,16,chr(9)),'"','','all')#', 53 :           '#replace(listGetAt(i,17,chr(9)),'"','','all')#', 54 :           '#replace(listGetAt(i,18,chr(9)),'"','','all')#',

    Code:

    " < cffile action ="read"file = ' http://website.com/Test1.txt "variable ="data"attributes"readonly"= > "

    < cfoutput >

    #data # < br >

    < / cfoutput >

    < cfloop index = "i" list = delimiters "" #data # "=" #chr (10) ##chr (13) # ">"

    < cfquery datasource = "X" username = 'Y' password = 'Z' timeout = "90" >

    INSERT INTO P2

    (MLSID,

    BathFull,

    BathHalf,

    Beds,

    BuildName,

    City,

    LandTenure,

    ListPrice,

    MatrixUID, MLSArea,

    Neighborhood,

    Parking,

    AddressOK,

    Photoelectron,

    PropertyType,

    Public,

    Status,

    Street name,

    StreetNumber,

    StreetSuf,

    Maint.

    Postal,.

    SQUARE FEET)

    VALUES

    (

    ' ' #replace (listGetAt (i, 1, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 2, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 3, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 4, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 5, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 6, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 7, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 8, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 9, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 10, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 11, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 12, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 13, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 14, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 15, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 16, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 17, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 18, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 19, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 20, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 21, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 22, chr (9)), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 23, chr (9)), ' "',", 'all' "") #

    )

    < / cfquery >

    < / cfloop >

    It is an example of the row of import information.  I've included headers to show spacing.

    MLS numberFull bathroomsHalf bathroomTotal of bedsName of the buildingCityLand ownershipPrice listUnique ID of matrixMajor area MLSDistrictTotal parkingAddress permit Internet YNCounty of photoType of propertyPublic remarksStatusThe street nameThe street numberStreet suffixMaintenance expensesZip codeTotal square feet
    28067821032275.001337510METROKALIHI VALLEY200NTRVALLEY OF KALIHI SERENE AND COOL.  LOCATED ON A PRIVATE ROAD.  DOWNSTAIR AVAILABLE 01/06/2008.  RENOVATED.  FURNISHED WITH REFRIGERATOR, microwave, WASHER and DRYER.  WATER, INCLUDED BASIC CABLE.  TENANTS HAVE SEPARATE ELECTRIC METER.  BEGIN TO SHOW THE 1ST WEEK OF MAY.  BY APPT ONLY.A1088

    My Question:

    I have no control over data entry.  Anyone of them can be empty.  I need to enter information, and preserve the integrity of the information.  How can I include the empty spaces, not knowing who will be empty and have the corrwectly to insert information in my database?

    Thank you in advance.

    This could give a try:

    INSERT INTO P2

    (MLSID,

    BathFull,

    BathHalf,

    Beds,

    BuildName,

    City,

    LandTenure,

    ListPrice,

    MatrixUID, MLSArea,

    Neighborhood,

    Parking,

    AddressOK,

    Photoelectron,

    PropertyType,

    Public,

    Status,

    Street name,

    StreetNumber,

    StreetSuf,

    Maint.

    Postal,.

    SQUARE FEET)

    VALUES

    (

    ' ' #replace (listGetAt (i, 1), ' "',", 'all' "'), #

    ' ' #replace (listGetAt (i, 2), ' "',", 'all' "'), #

    ...

    ...

    ...

    ' ' #replace (listGetAt (i, 23), ' "',", 'all' "") #

    )

  • Can I remove the empty space in a sprite sheet

    Hello

    The auto-generated sprite sheet Flash Pro CC has plenty of empty space.

    It is blowing the overall size of the published package - beyond the limit States the ad server.

    Before I go in and reduce the devil on the quality of the individual art, a few questions:

    1. is including the sprite sheet metal required, recommended, or does not matter - in regards to mobile platforms.

    2. can I I cut away excess space in the sprite kind of worksheet.

    Thanks in advance for any advice.

    El Rey

    In mobile, I guess look at a too average web pages in the mobile browser. The sprite sheet might affect mobile browsers in two different ways. In some cases, it might take the size of the file so high that the mobile browser cannot download as a single file, but as you talk about ads, I suspect it's a small file. On the bright side, having an image instead dozens of images will speed up the loading of the page.

    The spare white space does not significantly affect the size of the file. I suspect for the work of the canvas, you could cut out the white of the left and the lower part and it would continue to operate, I'll test a few days. For WebGL work you would normally keep the image as powers of 2 wide and high, because it goes into GPU memory, and who wants that the powers of sizes 2 textures.

    You should look at tinypng.com. There you can drag your great 32-bit PNG and get one that looks pretty much the same, but it's maybe 60-70% smaller. Simply keep the file of the same name and replace the 32-bit version in your pictures folder.

Maybe you are looking for