Filling space with non-visible component?

Is there a better way to fill space to squeeze objects closer together in a gridlayout/flowlayout than simply making gui components and setting their visibility to false?

I thought so too but...
newApplet.java:105: reference to add is ambiguous, both method add(java.awt.PopupMenu) in java.awt.Component and method add(java.awt.Component) in java.awt.Container match
               userNamePanel.add(null);

Similar Messages

  • Help Needed - replacing space with non-breaking space on the fly

    Hi,
    I have a text field I'm trying to fiddle the input on. Basically I want to replace all spaces (ascii code 32) with non-breaking spaces (ascii code 160) as they are typed.
    It seemed as though a KeyListener was the way to go, and I've successfully detected whenever a space is sent. I can consume() that KeyEvent, or setKeyChar to change it to another key. But I cannot see how to change it to a non-keyboard character.
    Any suggestions?

    i think you can do smt likeDocument doc = mySwingTextComponent.getDocument();
    doc.setDocumentFilter(new MyDocumentFilter());
    class MyDocumentFilter extends DocumentFilter {
       public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException {
          fb.remove(offset,length);
       public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
          replace(fb,offset,0,string,attr);
       public void replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException {
          text.replaceAll("SPACE","NB WHITE SPACE");
    }asjf
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/DocumentFilter.html

  • Filling clob with non ascii characters

    Hello,
    I have had some problems with clobs and usage of german
    umlauts (����). I was'nt able to insert or update
    strings containing umlaute in combination with string
    binding. After inserting or updating the umlaut
    characters were replaced by strange (spanish) '?'
    which were upside down.
    However, it was working when I did not use string bindung.
    I tried varios things, after some time I tracked
    the problem down to to oracle.toplink.queryframework.SQLCall.java. In the
    prepareStatement(...) you find something
    like
    ByteArrayInputStream inputStream = new ByteArrayInputStream(((String) parameter).getBytes());
    // Binding starts with a 1 not 0.
    statement.setAsciiStream(index + 1, inputStream,((String) parameter).getBytes().length);
    I replaced the usage of ByteArrayInputStram with CharArrayReader:
    // TH changed, 26.11.2003, Umlaut will not work with this.
    CharArrayReader reader = new CharArrayReader(((String) parameter).toCharArray());     
    statement.setCharacterStream(index + 1, reader, ((String) parameter).length() );
    and this worked.
    Is there any other way achieving this? Did anyone
    get clobs with non ascii characters to work?
    Regards -- Tobias
    (Toplink 9.0.3, Clob was mapped to String, Driver was Oracle OCI)

    I don't think the console font is the problem. I use Lat2-Terminus16 because I read the Beginner's Guide on the wiki while installing the system.
    My /etc/vconsole.conf:
    KEYMAP=de
    FONT=Lat2-Terminus16
    showconsolefont even shows me the characters missing in the file names; e.g.: Ö, Ä, Ü

  • JPopup with non-menu component

    I have included a small piece of code below that I am using.
    I basically want to add a small component of my own (represented by the closePopup button)
    to a JPopupMenu. When I finish performing operations on my component I want to close the popup
    menu, which I am doing using the setVisible(false) method.
    However, I get a focus problem on the parent frame. If I click on the "Show popup" button again it works
    fine. However if I click on the "Test" button after closing the popup. Then nothing happens, until I
    press it for a second time!
    Can anybody explain this to me. Am I going about this the wrong way. SHould I be using a JWindow
    instead or something along those lines
    Appreciate any response
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    * @author  grantl
    public class PopupTest extends JFrame implements ActionListener {
        private JButton showPopup, closePopup, test;
        private JPopupMenu popup;
        /** Creates a new instance of PopupTest */
        public PopupTest() {
            super();
            init();
            setVisible(true);
        public void init() {
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent we) {
                    System.exit(0);
            getContentPane().setLayout(new GridLayout(3,1));
            getContentPane().add(new JLabel("Test Label"));
            getContentPane().add(test = new JButton("Test"));
            getContentPane().add(showPopup = new JButton("Show popup"));
            closePopup = new JButton("Close popup");
            test.addActionListener(this);
            showPopup.addActionListener(this);
            closePopup.addActionListener(this);
            popup = new JPopupMenu();
            popup.add(closePopup);
            pack();
        public void actionPerformed(ActionEvent ae) {
            if (ae.getSource().equals(showPopup)) {
                Dimension d = showPopup.getSize();
                popup.show(showPopup, 0, d.height);
            else if (ae.getSource().equals(closePopup)) {
                popup.setVisible(false);
            else {
                JOptionPane.showMessageDialog(this, "Test");
        public static void main(String args[]) {
            new PopupTest();
    }

    I was seeing this problem in 1.3 also. I had a JButton that show()ed an instance of a subclass of JPopupMenu. Whenever I used setVisible(false) to hide the menu, it would not display on the next show(), but it would display on the second call to show().
    Calling MenuSelectionManager.defaultManager().clearSelectedPath() instead of setVisible(false) was the solution. Now I can hide the menu when needed and display it on show() every time.
    Thanks, teague.

  • Filling a rectangle space with a photo image in an applet

    I'm creating a web page that will display an image of a persons wall and I want to be able to use the mouse to draw a rectangle on the image of the wall and fill the space with a selected photo image.
    I have found out that you can use the MousePress and MouseDrag events to draw a rectangle and "paint" the rectangle in a componant inside the applet. But I'm not sure how to fill the rectangle with an image instead of a color. Can someone tell me if there is an AWT or Swing method that can do this?
    I was thinking of filling the applet window with a label component and then filling it with the wall image. Then some how using the coordinates given from the drag event to creat a new label component and filling it with the photo image. Hope I'm on the right path. Thanks for all the help.

    Great thanks, I looked it up in the docs and I found one that will work for me but I'm not sure how to use the arguements. It's the drawImage method that uses the scalebility. This would work perfect seeing as though the image to be posted will be various sizes. Can any one explain this method in more detail for me. Thanks again.

  • I have a 64GB iPad2 and selected to "Automatically fill free space with songs".... will it have to download that 60GB of music to my ipad everytime I sync?  It took about 8 hours to sync the music to it

    I have a 64GB iPad2 and selected to "Automatically fill free space with songs".... will it have to download that 60GB of music to my ipad everytime I sync?  It took about 8 hours to sync the music to it.
    I did this last night at 10pm thinking it would take 30 minutes to sync these 10,000 songs or so to my ipad to take up the 64 GB.  I went to bed because it was taking so long and woke up at 6am and it was just about to finish.  It finished around 630am.  So it took a good 8 hours to sync.
    I unhooked it and used it for an hour or so and then hooked it backup so that I could update a few apps on it.  When i did that it acted like it was re-adding all of those songs again and it took about 8 hours again to sync all the music.  Was that just a fluke because I made changes to the ipad?  or will it always calculate and then re-sync alllllllllllllllllll of those 10,000 songs?
    Thanks so much for any help!!!
    -Michael

    Anyone?

  • Needed?  Option to Fill Empty Space with Podcasts When Synching to a Device

    Hello,
    With the new 32 GB capacity of the iPhone 4, I find that I have a lot of remaining space after selecting 10 latest unwatched podcasts. On the other hand, if I select all unwatched podcasts to download, I get a warning that I have exceeded the capacity of the device.
    It would be nice if, in iTunes, the following options existed:
    1. Fill the empty space with selected podcasts
    2. Select 20 unwatched videos from the dropdown (in addition to the other existing options)
    3. Enter the number of podcasts the user wants to download for all podcasts.
    4. Enter the number of each type of podcast the user wants to download.
    There is an option to fill unused space with music, but no similar option for podcasts.
    I have submitted to http://www.apple.com/feedback, but I wonder if anyone else has this issue?

    AC Adam wrote:
    The only way I can think of to work around this might be to dump a lot of photos on the phone when syncing such that they take up an extra amount of space, then manually delete them from the phone interface once I get done. 
    That or add an App or Apps to take up the space.
    I would think there is more eloquent way to do this with through either iTunes or the iPhone.
    Nope.

  • Automatically fill free space with songs

    When I am syncing music to my iphone, and I check the box that says "Automatically fill free space with songs," how does itunes determine which songs it puts on my phone? Can I prevent it from placing unchecked songs in my library on my phone?

    Ah, it looks like the solution is here:
    http://discussions.apple.com/thread.jspa?messageID=12209799&#12209799
    And involves going to the summary tab, selecting "manually sync music" then deleting all of my songs and resyncing. That shouldn't take more than 45 minutes. I'll report back if it works.

  • "Automatically fill free space with songs" omits half my music

    This is a bizarre bug that I can't figure out. The "Automatically fill free space with songs" option on both my iPods and my iPhone will only select from songs that were in my iTunes library as of November 2009, about 7 months ago. I know this because I began importing a large portion of my CD library at about that time, and have been expecting to be hearing some new material (like the entire Beatles box set). Instead, I'm getting replays again and again of songs that I know were in there from before 11-09.
    Newer songs can definitely be imported as members of a synced playlist.
    I tried a complete rebuild of the iTunes library files -- all that did was screw up my Smart Playlists and reset my "Date Added" field for all songs.
    Does anyone have any clue on this?

    Ah, it looks like the solution is here:
    http://discussions.apple.com/thread.jspa?messageID=12209799&#12209799
    And involves going to the summary tab, selecting "manually sync music" then deleting all of my songs and resyncing. That shouldn't take more than 45 minutes. I'll report back if it works.

  • ITunes bug using "Automatically fill free space with songs"

    Using iTunes 10.1.0.54 on Windows 7 I've encountered an issue when using the "Automatically fill free space with songs" option with any of my iPod devices.
    The first time I synchronized my iPod using this option everything worked as expected - all the music from my selected playlists was transfered to the device as well as "random" music to fill the remaining space.
    However once I changed the content of the selected playlists and tried to synchronize the device again I got an over capacity warning since the selected music list was now larger than before.
    The only way to properly get my iPod to sync again was to deselect the "Automatically fill free space with songs" option, sync (removing all the extra songs), then re-enable the auto fill option and sync again.
    From a usability point of view this shouldn't be the expected behaviour. When the selected music set grows iTunes should randomly deselect music from the "auto fill" list on the iPod to allow the user to successfully sync their device.
    Is this really the intended behaviour from Apple or is this a bug in iTunes?

    you can report bugs to Apple via this site.
    JGG

  • Problem with 'Filling Space' described in Tim's Blog

    Dear Experts,
    I am using the Invoice Template described in the excellent Blog by Tim Dexter (Anatomy of a Template) to produce my own version. However, I am having problems with the 'Filling Space' described here: http://blogs.oracle.com/xmlpublisher/2007/03/anatomy_of_a_template_ii_heade.html
    My template is almost identical to the example, when I import XML data where there is only one record, the Filling Space does not pad out with enough empty rows so that the Total table is not at the bottom of the page, aligned with the watermark that I have. The code in the 'Filling Space' field is as in the Blog:
    <?if:not(count($invLines) mod $lpp=0) and ($start+$lpp>count($invLines))?><?for-each:$invLines?><?if:position()<$lpp - (count($invLines) mod $lpp)?>
    If the number of records is greater than half a page or more, then the padding is correct. This is even if, say on the third page there is just one record. Therefore, it seems the padding does not work if the number of records are less than half a page in total.
    Is this correct and does anyone have a solution - would be greatly appreciated.
    Many thanks,
    Mark

    "If the number of records is greater than half a page or more, then the padding is correct. This is even if, say on the third page there is just one record. Therefore, it seems the padding does not work if the number of records are less than half a page in total."
    This statement is wrong.
    Leave the if conditions logic,
    This is how it works,..
    xml contains 43 rows...
    each page you need 10 rows..
    after every 10th rows [using position mod 10 ,] , you put a page break...
    if the mod returns greater than 0, that means row filler has to come into effect now.
    what is the logic now to have row fillers is , 10 - 3 [position mod 10] , comes to 7... so seven blank rows should be inserted..
    this is how , it works...
    so the statement, saying, less than half of page, or something, wont come into this :).
    http://winrichman.blogspot.com/2008/09/limit-row-per-page.html

  • Visible/non-visible object with an anchor in a repeating frame

    I have one reapeating frame with some fields (horizontal in one line).
    The Repeating frame has the vertical elasticity = variable.
    In the repeating frame, above of all fields I created one object/rectancle, which is visble and non-vislbe by a trigger. This trigger function correcty.
    But the repeating frame doesn't to be variable, when this rectancle is non-visible.
    What is the problem ?

    Hallo Christian
    I could solve the problem as follows
    Repeating Frame
    inside 1st Frame for the visible/invisble trick including a trigger
    inside 2nd Frame for the fields
    Anchor from 2nd Frame to 1st Frame and another one from 1st Frame to the Repeating Frame
    => all frames and anchors vertical = variable

  • Does "Automatically fill free space with songs" refill the iPhone regularly

    I have a bit of music I'd like to have it shuffle, and having it essentially use the autofill command every time I sync my iPhone would be a bonus.
    So when you choose "Automatically fill free space with songs" in Sync Music, does it refill the iPhone's music regularly, or do you need to uncheck, sync, and check again in order to keep the autofilled music from stagnating on the phone?

    Also, how does it decide what to add to the iPhone?

  • How can I 'fill free space with songs' AND keep some memory free?

    I like the 'automatically fill free space with songs' option, but it leaves me with no room (or very little room) for taking photos and video.  How can I keep some memory free?
    Matthew

    You'll probably need to backup or clone the remaining OS X partition, definitely clone the bootcamp partition then erase and reformat the drive. You'll need a 3rd party app.
    Check out this thread:
    https://discussions.apple.com/message/9076113#9076113

  • When iTunes automatically fills free space with songs....

    When iTunes automatically fills free space with songs, where are these songs listed?
    I am very nearly at my limit, so been deleting a few playlists but as I was doing that, it seemed to be filling back up again just as quick.
    So I deselected the 'Automatically fill free space with songs' button, and the capacity has stayed exactly the same?
    Thanks
    James

    When iTunes automatically fills free space with songs, where are these songs listed?
    Under Songs, Artsts, Albums, etc.
    They are not in any playlist.
    I am very nearly at my limit, so been deleting a few playlists but as I was doing that, it seemed to be filling back up again just as quick.
    That menas that it is working exactly as it should.
    If you have select 2GB of playlists, iTunes will put 6GB on the iPod automatically.
    So I deselected the 'Automatically fill free space with songs' button, and the capacity has stayed exactly the same
    Nothing will change on the iPod until you sync it.

Maybe you are looking for

  • Cannot delete camera raw.8bi in Vista32 folder

    Hello - a peculiar access rights problem? I just manually updated ACR5.2 "camera raw.8bi" in the correct folder in Vista64 and in the CSPS4 64bit environment. I had no problem to overwrite the old file. Neither PS nor bridge are running. Now the same

  • OIM 9.1.0.2 installation

    Hi, I want to install oim 9.1.0.2 on weblogic server. Can you suggest weblogic version so that I can deploy OIM 9.1.0.2 Regards Sri

  • Oracle access manager: "You do not have sufficient access rights."

    Hi gurus, I'm doing self training on OAM, following an exercise I installed OAM and created a couple of Master Admins. Everything seams to work except the fact that this admins are not allowed to create users/orgs/groups and get the message "You do n

  • Hard time for selecting Startup Disk (partition) in Mac Classic II.

    Dear coleagues, I'd like your help to understand and solve a tricky trouble. I'm sorry for the long text, but the issue is probably living in a small detail. The issue regards a Mac Classic II with internal and external HDDs. Internal HDD has two par

  • How do i know if my photos are in my icloud?

    My iPhone took a little swim in the ocean yesterday and will not turn on.  How do i know if i have backed up my photos in the cloud?  Thank you!