Is it possible to set Borderlayout center part minimum with or height?

I want to preserve some space for the center part, but when the full panel size is small, the other parts will occupy most of the space and the center will be squeezed to very small space. I am wondering whether there is any method to preserve some space for center and maybe set a maximum size for south or other parts.

Using a JFrame as the root component in a 1.6+ JRE, there is this way..
import java.awt.*;
import javax.swing.*;
import java.io.File;
import java.net.URL;
class FrameMinimumSizeTextArea {
  public static void main(String[] args) {
    Runnable r = new Runnable() {
      public void run() {
        try {
          JFrame f = new JFrame("Minimum Size Set");
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JPanel p = new JPanel(new BorderLayout(3,3));
          File file = new File("FrameMinimumSizeTextArea.java");
          JEditorPane jep = new JEditorPane(file.toURI().toURL());
          jep.setPreferredSize(new Dimension(400,400));
          JScrollPane sp = new JScrollPane(jep);
          p.add(sp);
          f.setContentPane(p);
          f.pack();
          // this is the 1.6+ magic
          f.setMinimumSize( f.getSize() );
          f.setLocationByPlatform(true);
          f.setVisible(true);
        } catch(Exception e) {
          e.printStackTrace();
    EventQueue.invokeLater(r);
}

Similar Messages

  • Is it possible to set up a jam session with a friend over the internet in Garageband on iPad?

    Is it possible to set up a jam session with a friend over the internet in Garageband on iPad?
    Or is there any other way to set up a communication session where we can do a musical jam session via the internet?

    Garageband has no network collaboration functions that I know of. Whether there's some other software that will do that I don't know; perhaps someone else here will have a suggestion.
    Regards.

  • Is it possible to set up a bigger cluster with different AGs failover in sets of the nodes

    For SQL 2012 alwaysON, can it support this scenario?
    Set up a 12 node windows server failover cluster (A B C ... L)
    create 8 availability groups, let them fail over in 3 nodes of the cluster, e.g.
    AG1 failover in A B  C nodes
    AG2 failover in B C D nodes
    AG3 failover in C D E nodes
    etc.
    if this is supported, I guess then it's possible to say for any node in the Windows cluster, it can be at the same time be primaries for some AGs and secondaries for some other AGs (if we don't worry about performance)

    Microsoft supporting it is one thing. You and your team supporting it is another. Highly available systems need to be kept as simple as possible so long as it meets your recovery objectives and service level agreements. The question here is this: do all
    databases on those Availability Groups all have the same recovery objectives and service level agreements? This should dictate how you architect your solution
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course

  • Is it possible to set up a Pop server with Snow Leopard?

    I had to reinstall snow leopard and when I set up my mail application, the only choice I had was to set up my account using IMAP. Is it possible to switch to Pop or is that now out of the question?

    You can't change an account from IMAP to POP, but you could delete the account and re-create it as a POP account, if that is an option. (Why do you think you'll be able to switch to POP if that wasn't an option when setting up the account in the first place?) With IMAP, the mail should still be stored on the server, so you won't need to worry about backing it up before deleting the account. The one exception would be if you have set the Trash or Sent boxes associated with that account to not store mail on the server, in which case you'd need to back them up if you want to keep them.
    However, I'd recommend trying IMAP... in my opinion, it's far superior to POP, especially if you think you might ever want to view your mail from some other device.

  • Is it possible to set up 2013 Mac Pro with wireless keyboard?

    Is a connected keyboard required to set up 2013 Mac Pro or is it possible to do with just a wireless keyboard/mouse?

    I use the Blue Tooth Keyboard and Wireless mouse that came with my MacPro.  I've never had any trouble using it during a Fresh install setup.
    The Trackpad, however, is a different story.  That has never worked during the setup.  I have to get the OS istalled and set up the trackpad before I can use it.

  • Is it possible to set primary and secondary display with 2 graphics cards?

    I have an Early 2008 Mac Pro with two graphics cards and four monitors installed. Does anyone know how the computer (or more specifically Keynote) determines which is the primary display and which is the secondary?
    Also is there any way to change the scheme?
    What I am trying to do is switch the primary and secondary from the two monitors in my office to the monitor at the podium (would like it to become primary) and a vga projector (would like it to become secondary)
    I bought the second graphics card so I wouldn't have to switch the cables back and forth three times a week. All the monitors work fine, it's just a matter of determining or changing primary/secondary
    Thanks in advance

    Thanks Malcolm
    I got that far – The keynote manual says that the display with the menu bar is the primary display – that works out fine. The problem is that the manual says that the display without the menu bar is the secondary (or alternate). But there are three displays without the menu bar.
    What I would like to find out is: is there a way to choose the display without the menu bar to be the alternate?
    When I try various combinations, there seems to be no rhyme or reason as to which display is the alternate.
    Thanks again for your response!

  • Show new Jframe in BorderLayout.CENTER

    I write one JFrame with BorderLayout and Jmenu when I click Menu > Test I wana show me one new Jframe IN BorderLayout.CENTER.
    new Frame2(); with BorderLayout.CENTER. Plz Can sobody show me how can I do this.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
        class JFrameIconScrollPane extends JFrame {
             private JLabel label1, label2, label3, label4, label5;
             private JMenu menu;
             private JMenuItem menuItemTest;
            JFrameIconScrollPane()
                 super("JFrame Icon ScrollPane");
                 setLayout(new BorderLayout(5, 5));
                 label1 = new JLabel("---CENTER---");
                add(label1, BorderLayout.CENTER);
                label1.setOpaque(true);
                 label1.setBackground(Color.RED);
                label2 = new JLabel("---NORTH---"); 
                add(label2, BorderLayout.NORTH);
                label3 = new JLabel("--- WEST ---");
                add(label3, BorderLayout.WEST);
                label4 = new JLabel("--- EAST ---");
                add(label4, BorderLayout.EAST);
                label5 = new JLabel("--- SOUTH ---");
                add(label5, BorderLayout.SOUTH);
          JMenuBar menuBar = new JMenuBar();
          menu = new JMenu( "Menu" );
          menuBar.add(menu);
          menuItemTest = new JMenuItem( "TEST" );
          menu.add(menuItemTest);     
    // (creates a listener)
          TestListener theTestListener = new TestListener();
          menuItemTest.addActionListener(theTestListener);
           setJMenuBar(menuBar); // set menu bar for this application               
            class TestListener implements ActionListener
                 public void actionPerformed(ActionEvent event)
                      new Frame2();
           public static void main(String args[])
                  JFrameIconScrollPane j = new JFrameIconScrollPane();
                  j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 j.setSize(900, 600);
                 j.setVisible(true);
                 j.setLocationRelativeTo(null);
    and new JFrame
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
        class Frame2 extends JFrame{ 
             private JLabel label1, label2, label3, label4, label5;
            Frame2() {
               setLayout(new BorderLayout(5, 5));
                 label1 = new JLabel("Frame 2---CENTER---");
                add(label1, BorderLayout.CENTER);
                label1.setOpaque(true);
                 label1.setBackground(Color.RED);
                label2 = new JLabel("Frame 2---NORTH---"); 
                add(label2, BorderLayout.NORTH);
                label3 = new JLabel("Frame 2--- WEST ---");
                add(label3, BorderLayout.WEST);
                label4 = new JLabel("Frame 2--- EAST ---");
                add(label4, BorderLayout.EAST);
                label5 = new JLabel("Frame 2--- SOUTH ---");
                add(label5, BorderLayout.SOUTH);
                    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    setSize(360, 350);
                    setVisible(true);
                    setLocationRelativeTo(null);
        }

    this may be close to what you're trying to do, using a CardLayout.
    clicking the menuItem changes the entire display.
    if you just want the center part to change, a slight modification is required.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class JFrameIconScrollPane
      private JLabel label1, label2, label3, label4, label5;
      private JMenu menu;
      private JMenuItem menuItemTest;
      CardLayout cl = new CardLayout();
      JFrame f;
      JFrameIconScrollPane()
        f = new JFrame("JFrame Icon ScrollPane");
        f.getContentPane().setLayout(cl);
        JPanel p = new JPanel();
        p.setLayout(new BorderLayout(5, 5));
        label1 = new JLabel("---CENTER---");
        p.add(label1, BorderLayout.CENTER);
        label1.setOpaque(true);
        label1.setBackground(Color.RED);
        label2 = new JLabel("---NORTH---");
        p.add(label2, BorderLayout.NORTH);
        label3 = new JLabel("--- WEST ---");
        p.add(label3, BorderLayout.WEST);
        label4 = new JLabel("--- EAST ---");
        p.add(label4, BorderLayout.EAST);
        label5 = new JLabel("--- SOUTH ---");
        p.add(label5, BorderLayout.SOUTH);
        f.getContentPane().add("0",p);
        f.getContentPane().add("1",new Frame2().getFrame2Panel());
        JMenuBar menuBar = new JMenuBar();
        menu = new JMenu( "Menu" );
        menuBar.add(menu);
        menuItemTest = new JMenuItem( "Other Panel" );
        menu.add(menuItemTest);
        TestListener theTestListener = new TestListener();
        menuItemTest.addActionListener(theTestListener);
        f.setJMenuBar(menuBar);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setSize(900, 600);
        f.setLocationRelativeTo(null);
        f.setVisible(true);
      class TestListener implements ActionListener
        public void actionPerformed(ActionEvent event)
          cl.next(f.getContentPane());
      public static void main(String args[]){JFrameIconScrollPane j = new JFrameIconScrollPane();}
    class Frame2
      private JLabel label1, label2, label3, label4, label5;
      public JPanel getFrame2Panel()
        JPanel p = new JPanel();
        p.setLayout(new BorderLayout(5, 5));
        label1 = new JLabel("Frame 2---CENTER---");
        p.add(label1, BorderLayout.CENTER);
        label1.setOpaque(true);
        label1.setBackground(Color.RED);
        label2 = new JLabel("Frame 2---NORTH---");
        p.add(label2, BorderLayout.NORTH);
        label3 = new JLabel("Frame 2--- WEST ---");
        p.add(label3, BorderLayout.WEST);
        label4 = new JLabel("Frame 2--- EAST ---");
        p.add(label4, BorderLayout.EAST);
        label5 = new JLabel("Frame 2--- SOUTH ---");
        p.add(label5, BorderLayout.SOUTH);
        p.setPreferredSize(new Dimension(360, 350));
        return p;
    }

  • Is it possible to set up a session with an expert for a team?

    I'm the administrator for a small CC team. While a couple of us are fairly comfortable with the Adobe suite, we're bringing in a few single-app subscribers who need to learn the basics (InCopy specifically). Is it possible to set up a group session with an Adobe expert, i.e. a conference line we can dial in to, so that we're all on the same page?

    Certainly you can setup an expert session. Please go through the link below to setup a session with Adobe experts.
    https://helpx.adobe.com/creative-cloud/team/creative-cloud-teams.html#
    Hope this helps.
    Thanks,
    Ashish

  • Is it possible to set up home sharing with my daughter's laptop - she lives in a different part of the country?

    is it possible to set up home sharing with my daughter's laptop - she lives in a different part of the country?

    Unfortunately, no. Home sharing only applies to devices sharing the same Wifi network.
    iTunes Match is an alternative to look into.
    Apple - iTunes - Match

  • Is it possible to set a different color to part of a cell?

    Hi all,
    I am have trouble setting cell-specific Renderer.
    I have followed the instructions in the UISwing tutorial
    and extended JTable definition to overload getCellRenderer()
    to return myRenderer
    final JTable tableView = new JTable(dataModel){
    public TableCellRenderer getCellRenderer(int row, int column) {
    TableCellRenderer colorRenderer = new ColorRenderer();
    return(colorRenderer);
    My class definition for ColorRenderer is as follows:
    class ColorRenderer extends JLabel implements TableCellRenderer {
    public ColorRenderer() {
    public Component getTableCellRendererComponent(
    JTable table, Object color,
    boolean isSelected, boolean hasFocus,
    int row, int column) {
    setForeground(Color.blue);
    return this;
    Is it possible to set a different color to part of a cell?
    eg. I have "TEST,CELL,COLOR" as a string in a cell.
    Can I set a different color to the substring "CELL"?
    Your suggestions will be accepted most gratefully!
    Thanks in advance
    -Kalpana

    You should inherit your table cell renderer from a container, for example JPanel, add different JLabels to the panel and color them separately.
    Kurta

  • It should be possible to set default behavior for all file types

    It should be possible to set a default action for all file types. I'm so tired of having to manually sit and say "save this file" because Firefail always defaults to "open with" and has disabled the "Do this automatically for files like this from now on."
    And spare me the zealotry religious excuses for why its the fault of websites and not Firefail
    ''edited to remove swearing''

    I do want users to have full control to be able to set any folder view they want by using Apply to Folders; I just want to set the initial/default view to Detail because that matches what the majority of my users want.
    That is, what registry setting changes when I go to a picture folder, change the view to Detail, and click Apply to Folders? Having done that, I still retain the ability to change it to some other view and apply that to folders. But what registry setting
    represents the change I just made when applying Detail view to all Picture folders.?
    This settings is simple via GUI, but it is related a lot of registry keys, I made a test in my machine, capture the "Apply to Folders" process using Regshot tool (this is a small tool which can compare the regsitry changes after you change some
    settings), and this is the result:
    this is part of the registry changes, a plenty of registry keys and values need to be changed. hard to list them here. if you have interests, I recommend the tool Regshot, it can help you capture the regsitry changes.
    NOTE: Please Note: The third-party product discussed here is manufactured by a company that is
    independent of Microsoft. We make no warranty, implied or otherwise, regarding this product's
    performance or reliability.
    Yolanda Zhu
    TechNet Community Support

  • How to set Borderlayout?

    Hi all,
    I used BorderLayout in JPanel. I have added JTextArea at CENTER and JList at EAST.
    Jpanel is in JFrame.
    The size of JList is depend on Element that longest but when I remove all element and try to
    resize JFrame, the JList which has no element extend its size to half of frame.
    The point is How can I set size of Jlist to extend depending on Frame size.
    Or Can I fix the size of Jlist in BorderLayout.
    Help...please

    Sizing problems can usually be solved by setting the correct preferred, minimum and maximum size.
    In your case try to set the maximumSize to a very big one (e.g. 32678, 32768)
    If that still doesn't help you might want to look into a different LayoutManager.
    Thomas

  • Sap sd set profit center as mandatory field in va01

    Hi guru's
    here to set profit center field as mandatory in va01 i know the configuration in SD.
    but this profit center field in va01 by default triggering one dummy profit center automatically.
    i already set the configuration but not working bcoz of this dummy profit center.
    provide the solution as soon as possible.
    Best Regards
    Prasad.

    hi,
    U can use Incompletion Log else transaction variant for the same.
    Goto Tcode:SHDO -
    > Transaction Code=VA01->Transaction Variant=bus2032>click  with processing ikon on the top -> search for the field PRCTR (profit center)-> make it requred field
    hope this helps u
    regards,
    Arun prasad C R

  • TS4268 I was accedentally deleted my facetime. then after that from now on i cant see my facetime button in my home screen and also in setting. im just see my facetime in setting noicifation center. and i tried to check at my contact i didnt see also face

    I was accedentally deleted my facetime. then after that from now on i cant see my facetime button in my home screen and also in setting. im just see only my facetime in setting>noicifation center. and i tried to check at my contact i didnt see also facetime in lower part. please help me,. thank you

    Hi LifeGood,
    Thanks for using Apple Support Communities.  In iOS, FaceTime is not a separate app and FaceTime calls can be made as described here:
    iOS: Using FaceTime
    http://support.apple.com/kb/ht4319
    How do I make a FaceTime call?
    You can make a FaceTime call in multiple ways, depending on your device:
    iPhone 4 or later: You can place a FaceTime call using the following apps:
    Phone: While on a phone call, you can tap the FaceTime icon to invite the other party to a FaceTime call.
    Contacts: Tap the FaceTime icon to place a FaceTime call to the contact you are viewing.
    iPad 2 or later, iPad mini, iPod touch (4th generation) or later, and FaceTime for Mac: You can place a FaceTime call using the following apps:
    FaceTime: Place a FaceTime call using your contacts list.
    Contacts: Tap the FaceTime icon to place a FaceTime call to the contact you are viewing.
    Note: There is no FaceTime app on iPhone. Use the Phone app instead.
    Cheers,
    - Ari

  • Possible to set Preview Checkbox 'On' as Default?

    Hi there again Illustratophiles!
    I spent this morning setting up my function keys to Illy menu commands (check out Microsoft's Wireless Keyboard 1000; it works on Mac and Win and has 20+ extra configurable keys in addition to the function keys -- I'm on the Mac and use it for application launching, expose, find file, and setting function keys in multiple applications). Still can't map any tools to function keys (grumble grumble) but that is another post entirely.
    I also spent some time configuring one of my New Document Profiles, and am curious if it is possible to set all the Preview checkboxes to On as the default setting. For instance, if I am editing an existing global color swatch and want to see the results before comitting I have to click the Preview checkbox in the dialog box. Or, if I am in the Move dialog box. Or if I am using one of the Effects. It would save me some time if this is possible.
    Cheers in advance and all that.
    -g-

    Open the New Document Profile you want and uncheck the Hyphenate box in the Paragraph panel. Then save the file, overwriting the original. As for the first part, most of what you are describing are handled by .aip or plugins and are essentially a compiled software that could only be changed by the originators. Not to say it wouldn't make a good feature request.

Maybe you are looking for