Unexpected space added to a JSplitPane

Hello,
there is a strange problem with a JSplitPane that I cannot figure out. As seen below, a JSplitPane and another JPanel are added to a JPanel with a BoxLayout, creating a gray area above the JSplitPane. When commenting the code below (XXX), the space disappears. Any hint or suggestion of how to get rid of that unwanted area are more than welcome!
Thanks a lot,
Eph
package test;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
public class Bug extends JFrame
public Bug()
create_content();
setPreferredSize(new Dimension(600, 400));
pack();
private void create_content()
setTitle("Bug Tester");
// Main Panel
JPanel main_panel = new JPanel();
main_panel.setLayout(new BoxLayout(main_panel, BoxLayout.X_AXIS));
setContentPane(main_panel);
// Split Pane with two labels
JSplitPane test = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
test.setBackground(Color.YELLOW);
test.setLeftComponent(new JLabel("1"));
test.setRightComponent(new JLabel("2"));
main_panel.add(test);
// Another pane
// (XXX) Commenting the following lines makes the extra space disappear
JPanel test2 = new JPanel();
test2.setBackground(Color.BLUE);
test2.add(new JLabel("3"));
main_panel.add(test2);
public static void main(String[] args)
javax.swing.SwingUtilities.invokeLater(new Runnable()
public void run()
Bug b = new Bug();
b.setVisible(true);
}

Looks like the default Y-axis alignment of a split pane is 0.0f while that of a panel is 0.5f. BoxLayout is bit odd in that it gets the layout constraints directly from the JComponent instead of a separate constraint value (like most other layouts).
Add the following to fix your example:
test.setAlignmentY(0.5f);

Similar Messages

  • White space added to end of slideshow

    I've created a slideshow in 5.5 and at the end of my slideshow when it's played (either in project preview or exported to YouTube) there is about :40sec of white space added in.
    What could I have done to create this? The last slide is an image slide, there is nothing beyond that.
    Also, is there a way to instruct the slideshow to repeat at the end or is there a player besides a YouTube player that will repeat once it reaches the end?
    Many thanks for the help!

    Thanks, Andy!  That was helpful.
    Here is a screen shot of the last slide: 
    In the Project Preview within Captivate, there is no white addition.  It is when I upload it to YouTube is when the additional white space is added on - it adds about :40sec or so of white before it fades out.
    Thanks so much for your help - I've been trying to figure this out for awhile!

  • Premiere Elements 12 - My videos have extra minutes of black space added that I don't know how to get rid of.

    I just finished making a video that runs to about the 13 minute mark. After that I don't have anything on the timeline. Despite this, the duration I see when I try to export is about 25 minutes. I then watched the video to confirm that I had an extra 12-13 minutes or so of blank, black, empty space added to the end of the video. I made doubly sure that there was no tiny file a chopped off on accident or anything, there's just nothing there. This has been a recurring problem, having occurred with a 7-ish minute video being expanded to 15.

    born
    What computer operating system is your Premiere Elements 12 running on? Be sure to update 12 to 12.1 via a project's Help Menu/Update. Background information. For now I will assume Windows 7, 8, or 8.1 64 bit.
    Now to the core of the matter and a quick way to find and correct the problem which is related to fragment beyond what you consider to be the end of your Timeline content.
    1. Open the project to the Expert workspace. Expand the Timeline content maximally by taking the Zoom Out-Zoom In Slider above the Timeline all the way to the right.
    2. Hit the computer keyboard End Key. That should take the Timeline Indicator to the spot where the fragment(s) is (are)..
    These fragments typically present as thin vertical black lines scattered among the track contents. Could even be a file that you pushed out of the way when
    you were editing and forgot you left it there. Search all tracks.
    3. After you find and delete it or them, then use the End Key again to make sure that this time Timeline Indicator stops at the end of your intended Timeline content when you press the computer keyboard End key.
    Any questions or need clarification, please do not hesitate to ask.
    Thank you.
    ATR

  • Why is there unwanted white space added to all .jpg/.png when "inserted" into Dreamweaver CS4?

    I have two seperate sites/seperate root folders that I am building right now and every image that I insert into Dreamweaver has an extra white space added to the left of every image. Please help, I must have checked/unchecked something in my preferences. Thank you!
    Its not in my CSS or in the HTML coding...from my site:
    <a href="optomized-large/Havana-Night-(66-of-312).jpg" title=""> <img src="optomized-thumb/Havana-Night-(66-of-312).jpg" width="100" height="150" alt="" /> </a>

    You do know how wrong it is to make a web page that is nothing but images, right? It's on the list of the 10 worst mistakes you can make for sure.
    Anyhow, look at this page -
    http://www.murraytestsite.com/denver.html
    I have outlined every image on that page with a 1px red border.  There is no unwanted white space being added to those images.  If there were you would never see the menu button images that close together.  I have also put a 1px green border on the left of the container div.  Note that the images are snug against that green border.

  • Why bookmarks have 4 spaces added after the update from FF3.6 to 13?

    Why bookmarks have 4 spaces added after the update from FF3.6 to 13?

    Problems with bookmarks and history not working properly can be caused by a corrupted places.sqlite database file.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    You can also try to repair the places database with this extension:
    *https://addons.mozilla.org/firefox/addon/places-maintenance/

  • Extra spaces added (that I can't get rid of) when using STHeiti font.  Anything I can do?

    Hi there,
    When I use the font that I want to use (STHeiti), extra spaces get added automatically—spaces that, by the way, I can’t ‘delete’—after every apostrophe (or single quotation mark).  See screen grabs below:
    Here's another example:
    Do you know how I can make these spaces go away?  When I do a search on the internet (InDesign STHeiti), I see that others have had other types of problems with this font… having to do with exporting a finished project to pdf and getting it printed. 
    In the context of talking about it, one person says that the STHeiti font "is installed as part of the Apple operating system, and is probably only meant for onscreen display".
    But someone else adds:  "the font is installed, by default, on all macs running 10.4 and above (possibly further back than that, but lets go with what we know), so opening the file at the printers on such a mac will have the font available”
    I'm on my Mac, though (not yet ready for the printer), so why do I have a problem using this font?
    I know I could use another font, but this STHeiti is a really nice one!
    Thanks for any advice,
    Malcolm

    Wow... that works beautifully.
    I've done it, but before proceeding too much further I'll google and try to find out more about this "Use Typographer's Quotes" setting.  Don't want it to bite me down the road.
    Thanks very much for the tip—
    Malcolm

  • Extra space adding during spool data into text file

    I'm using sql developer to query oracle tables. I can export data using GUI of sql developer, but I wish to use spool query to export the data. Using below query, I was able to export the data to specified location, but my final text file consist of additional spaces after each line. These additional spaces between each line is causing an error to upload the text file in different location.
    Did any one face have this issue? Below is my query
    set head off
    SET FEEDBACK OFF
    SET ECHO    OFF
    SET TRIMSPOOL ON
    SET TRIMOUT ON
    spool c:\test.txt
    select cast(memberid||',12'as varchar2(20))
    from abc;
    spool off
    set head on
    set ECHO on
    i'm using trimspool, and trimout, but it is not removing any blank spaces.

    Sorry, I changed my export.sql to the query you provided.
    SET HEAD OFF FEED OFF ECHO OFF
    SET LIN 120 PAGES 0 TRIMS ON
    SPOOL c:\test.txt
    SELECT memberid || ',12' FROM abc;
    SPOOL OFF
    But,the spool query is still adding additional spaces making length of each line 43 characters in final text file output.

  • Space added to path when using graphics extension

    Hi,
    I'm having a strange problem.  I use the 'chart' element of BSP extension 'graphics', but this doesn't show me the generated graph in the portal.
    I've done some debugging and I've found out that this extension uses the method cl_graph_util=>publish_blob for putting the generated image in the server cache and generates a url inside the application.
    For retrieving the current application.  This method uses  
    path = request->get_header_field( '~PATH_TRANSLATED' ).
    Now after this call, the content of the variable 'path' is '/sap/bc/bsp/arinso/EAQ_BP /output/result.do'.  So a space is added after the name of my BSP application and before the subfolder that contains my controller.
    Can anyone tell me where I might have misconfigured something that causes this?
    Thanks,
    Tim

    I couldn't find what causes it, but I've solved it by putting this code, just before the chart tag.
      data l_path type string.
      l_path = request->get_header_field( '~PATH_TRANSLATED' ).
      condense l_path no-gaps.
      request->set_header_field( name = '~PATH_TRANSLATED'
      value = l_path ).

  • Remove spacer added to dock

    Good day to all of you!
    How can I remove a spacer that was added to my dock through a third part application? I have tried restarting the dock, removing the application (Cocktail) and checking in system preferences. I can not find a remedy for the mistake I made. Any help would be much appreciated! Thanks!
    N8

    Hi Nathan,
    Try deleting or removing your Dock's preferences (which will reset it to the defaults). This file is located at /Users/"Your username"/Library/Preferences/com.apple.Dock.plist.
    Hope that helps!
    —Hazy

  • Why extra space added in generated HTML?

    We've noticed that WebLogic adds a significant amount of space in generated
              HTML (like 3.5K). We're curious if there is a way to prevent this or limit
              the amount of this space since this adds extra unnecessary wait time for
              dialup users. Does anyone have experience with this?
              

              My reply was entirely garbled ... I am trying again
                        Some HTML<br>
              <% jsp code ...<br>
              %>
                                  Instead use...
                        Some HTML<% <BR>
              jsp code ...<br>
              %>
                                            "Shubhrajit Chatterjee" <[email protected]> wrote:
              >
              >Hi,
              >In case the problem has not been solved yet...
              >
              >If you begin a scriptlet tag(or any server side tag) on a new line like
              >this...
              >
              >Some HTML
              ><% jsp code ...
              >%>
              >
              >then when the servlet is generated, one empty out.println() is coded
              >due to the
              >empty place between the scrptlet tag, and thus generating an empty line
              >
              >You can prevent this by starting every scriptlet ( or any other serverside
              >tag
              >in the same line as HTML as given below
              >
              >Some HTML<%
              >Some JSP
              >%>
              >
              >However, only two characters (CR and LF are added if the scriptlet starts
              >on the
              >first column, so this won't make the page much slower. Avoid giving spaces
              >before
              >starting scriptlets, however...
              >
              >Shubhrajit
              >
              >
              >
              >"Dmitry Namiot" <[email protected]> wrote:
              >>
              >>Check out Optimize taglib from Coldtags suite:
              >>http://www.servletsuite.com/jsp.htm
              >>
              >>"chip" <[email protected]> wrote:
              >>>We've noticed that WebLogic adds a significant amount of space in generated
              >>>HTML (like 3.5K). We're curious if there is a way to prevent this
              >or
              >>>limit
              >>>the amount of this space since this adds extra unnecessary wait time
              >>>for
              >>>dialup users. Does anyone have experience with this?
              >>>
              >>>
              >>
              >
              

  • TM2: Unwanted space added to the left of handwritte​n text

     TM2t-1000 CTO
      Intel SU7300,  ATI 4550, 4Gb RAM, 500Gb HD
    Win7 Home Premium 64 bit (OEM  install)
    Hi there!
     This problem has plagued me since I got my TM2 in April. When I input text using the Handwriting Pad, an extra space is added to the left of the first letter I handwrite.  For example. If I try  to handwrite Hello Word!, the sentence  will look correct inside the Handwriting Pad, however, after a press the INSERT button, this is what is input instead:
    _Hello Word!  <-- underscore  represents a space.
     I'm then forced to delete the extra space before the letter  H. Next, If I reopen the Handwriting Pad to  change WORD into WORLD, this is what happens after  I handwrite  the letter L and press the  INSERT button:
    _Hello Wor_ld!  <-- underscore  represents a space.
     The Handwriting Pad adds a space + L. As you can see throughout this post, there are several extra spaces before words. This problem happens in several  different programs.  Here is a short list:
    Programs affected by the bug
    Visual C# Express 2005
    Google Chrome 5
     Mozilla Firefox 3.6
     Mozilla Thunderbird 3.1
     Notepad ++5
     Window Live Mail 14
    Strangely, this problem does not happen on Windows' own Notepad  or WordPad.  I'd like to  stress that the extra spaces do not appear on the Handwriting Pad! They are  only introduced once the text is inserted into an application  (like the text box where I've  entered my post  here).  I have an  old HP TC 1100 Tablet running Windows XP and,  with it, no extra spaces are added  before any letter, word or sentence  I handwrite.  This is the only problem with my TM2.  Quite  annoying!

    Hi Frank,
    Thank you for replying.
    Unfortunately, neither solution fixed the issue.
    The margin (if this is the correct terminology) is inside the text box, not the page of the document. Also, my insert margin is at zero.
    To describe it in more detail:
    I have a text box with a dotted line border. Inside the text box are the words "participant copy" (no quoatation marks). On my ruler, up the top of the page, I only have the left triangle/topbar (first line indent) marker on the left and the triangle marker on the right. There are no tabs there at all.
    The right triangle marker will draw a straight line to the text when I move it inwards. However, the left marker will never touch the text - always being about 2cm away from it. What I want to do is be able to move the words "participant copy" to the edge of the box and then centre the text. I can't seem to get the words to the left edge of the text box.
    Thanks again,
    Anthony.
    PS - I can email you a copy of the file if that will help clear it up.

  • Unexpected error - adding legal entity to ledger

    Hello guys,
    I got the usual unexpected error while trying to apply a legal entity to a ledger in R12.
    I have tried to clear the cache but to no avail
    Any idea will help
    Regards

    Hi,
    this is common on almost any web page functionality, if this is highly recurring i.e. reproducible at will you can approach oracle support and get a code fix ....
    However if this is occassional and does not follow a pattern/trend, this would be a Intermittent issue ...
    Clearing Cache, bouching apache are the common fix for these errors ... some times logging off and logging in again, clearing your browser cache and temp files also resolves this error ....
    Regards,
    Ivruksha

  • Space added at top when making a pdf from word

    Hi there. I created a word doc template for a client and when they create a pdf, it adds about .5" at the top and bottom. I'm not sure why that is ... It creates fine on my end. Any insight? Thanks so much!

    You are probably going to have to find out what he is using to create the PDF and possibly check with that software. With the newer WORD, he may be creating with the MS plugins. That may be the problem. In any case, it does not sound like an Acrobat issue, but a 3rd party problem.

  • Apple Mail crashes unexpectedly while adding any kind of attachment

    Hi there - so many topics of mail not working correctly - and my problem is still not discussed.
    First of all: Apple Mail (Version 2.1.1) used in combination with a POP account ALWAYS quits when I try to add a Quicktime, .jpg, .wav, .mov, wmv or any kind of MS office document. ALWAYS.
    I tried to setup a new account an kill the old one - same problem.
    Even a different account did not work. I also killed the whole Mail programm and did a new setup - it would not work.
    I use the same account on my MacBook Pro and do not have any problems like that.
    Has anybody any idea? Thanks in advance, a bug report can also be provided but I did not want to spam the board.

    Hi doc_muteki.
    Actually, there is another thread from just two days ago discussing the same problem you have:
    Mail crashes when attempting to add attachment
    Post the relevant portion of the crash report here (as described in that thread) if the suggestions provided there don’t work for you.

  • Space added to tracks

    I put sound bites between music tracks on my playlists. When I burn the CD, iTunes (7.0.2) increases each sound bite to a 6 seconds if it is less than 6 seconds (which most of them are). This was never the case in earlier versions of iTunes. Is there a way to fix this?
    FYI, I have "Gap Between Songs" set to "none." If I set it to an amount of time, it adds that amount to the end of the track.

    Thanks for your response.  I don't think a reset would have changed anything ... I examined the linkage problems more closely and found that correcting naming errors and un-selecting "compilation" in a few instances was a fix.  I would suggest that Apple tech-writers invest a few words in making distinct the concepts of collection (of multiple disks in a multi-disk set) and "compilation" (whatever that is). 
    Billy

Maybe you are looking for