BorderLayout

When I compile this code I have an error:
Error 13: class borderLayout not found in class Challenge2.Challenge2
package Challenge2;
import javax.swing.*;
import java.awt.*;
public class Challenge2 extends JFrame {
public void Challenge2() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container Panel=getContentPane();
Panel.setLayout(new Borderlayout());
JButton Boton=new JButton("Incrementar");
JLabel Contador =new JLabel();
Panel.add(Boton,BorderLayout.NORTH);
Panel.add(Contador,BorderLayout.SOUTH);
setVisible(true);

if you pasted the code, the solution is to use
BorderLayoutjuergen

Similar Messages

  • How can I create a single background image for a BorderLayout?

    I can create a background with an image file for the individual panel (North, West, Center, East and South) in a BorderLayout, but I've been spinning my wheel for a long while now trying to figure out how to create just one background with a single image file for all of these panels?
    In my application, a panel may contain various buttons, a listbox, a group of checkboxes, a combo box, or a canvas. Even if I used the same image file, when the panels are finally put together, one can clearly see that the end product is the result of a lot of patch works.
    Hope someone has an answer for this. BTW, I'm using AWT because it works with existing browsers without the need for a separate Java plug-in.
    Regards,
    V.V.

    Look at this :
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.awt.image.BufferedImage;
    public class PanI extends Frame
         Image map;
         Panel pan;
         myPan p8,p4,p6,p2,p5;
         BufferedImage I;
    public PanI() 
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);}});
         map = getToolkit().getImage("map2.gif");
         MediaTracker tracker = new MediaTracker(this);
         tracker.addImage(map,0);
         try   {tracker.waitForID(0);}
         catch (InterruptedException e){}
         I = new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
         setBounds(10,10,map.getWidth(null)+8,map.getHeight(null)+27);
         setLayout(new BorderLayout());
         pan = new Panel();
         add(pan,BorderLayout.CENTER);
         pan.setLayout(new BorderLayout());
         pan.setSize(map.getWidth(null),map.getHeight(null));
         p5 = new myPan(5);
         p5.setBackground(Color.red);
         pan.add(p5,BorderLayout.CENTER);
         p8 = new myPan(8);
         p8.setBackground(Color.orange);
         pan.add(p8,BorderLayout.NORTH);
         p4 = new myPan(4);
         p4.setBackground(Color.blue);
         pan.add(p4,BorderLayout.WEST);
         p6 = new myPan(6);
         p6.setBackground(Color.green);
         pan.add(p6,BorderLayout.EAST);
         p2 = new myPan(2);
         p2.setBackground(Color.pink);
         pan.add(p2,BorderLayout.SOUTH);
         setVisible(true);
    public class myPan extends Panel
         int where;
    public myPan(int i)
         super();
         where = i;
    public void paint(Graphics g)
         if (I.getWidth(null) != pan.getWidth() || I.getHeight(null) != pan.getHeight())
              I = new BufferedImage(pan.getWidth(),pan.getHeight(),BufferedImage.TYPE_INT_ARGB);
              Graphics      G = I.getGraphics();
              G.drawImage(map,0,0,pan.getWidth(),pan.getHeight(),null);     
              G.dispose();
         int x1=0;
         int x2=getWidth();
         int y1=0;
         int y2=getHeight();
         if (where == 8)
         if (where == 2)
              y1 =  p8.getHeight()+p5.getHeight();
              y2 =  getHeight()+y1;
         if (where == 4)
              y1 =  p8.getHeight();
              y2 =  y1+getHeight();
         if (where == 5)
              x1 =  p4.getWidth();
              x2 =  x1+getWidth();
              y1 =  p8.getHeight();
              y2 =  y1+getHeight();
         if (where == 6)
              x1 =  p4.getWidth()+p5.getWidth();;
              x2 =  x1+getWidth();
              y1 =  p8.getHeight();
              y2 =  y1+getHeight();
         g.drawImage(I,0,0,getWidth(),getHeight(),x1,y1,x2,y2,null);
    public void update(Graphics g)
         paint(g);
    public static void main (String[] args) 
         new PanI();
    Noah

  • Why doesn't borderlayout work?

    Borderlayout seems to not work here. I need the textfield to be north, two buttons under that, and then a label south, but it only shows the label, but if I comment out the field, I see the buttons, please help, here is my code
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    class GUI
         private JLabel label1;
         private JButton clear;
         private JTextField field1;
         public static void main(String[] args)
              final JFrame f = new JFrame("");
              /*Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              screenSize.width -=42;
              screenSize.height -= 42;*/
              f.setSize(1024,768);
              f.setLocation(20,20);
              f.setVisible(true);
         final JDesktopPane desktop = new JDesktopPane();
              desktop.setPreferredSize(new Dimension(1024, 768));
              desktop.setBackground(new Color(148,102,75));
              desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
              f.setContentPane(desktop);
              final JInternalFrame fr = new JInternalFrame("infix", false, true, true, true);
              fr.setSize(203, 126);
              fr.setLocation(50, 50);
              fr.setVisible(true);
              fr.setOpaque(false);
              fr.setBackground(new Color(100,0,255,140));
         JPanel panel = new JPanel();
         panel.setLayout(new BorderLayout(0,0));
              panel.setSize(203,126);
              panel.setBackground(new Color(0,0,255,140));
              panel.setOpaque(false);
              JTextField field1 = new JTextField("",60);
              field1.setPreferredSize(new Dimension(200, 21));
              panel.add(field1,BorderLayout.NORTH);
              JButton evaluate = new JButton("Evaluate");
              evaluate.setPreferredSize(new Dimension(115,25));
              panel.add(evaluate,BorderLayout.CENTER);
              JButton clear = new JButton("Clear");
              clear.setPreferredSize(new Dimension(115,25));
              panel.add(clear,BorderLayout.EAST);
         JLabel label = new JLabel("");
              label.setPreferredSize(new Dimension(34,100));
              panel.add(label,BorderLayout.SOUTH);
              fr.add(panel);     
              desktop.add(fr);
              JInternalFrame fr2 = new JInternalFrame("test", true, true, true,false);
              fr2.setSize(230, 300);
              fr2.setLocation(50, 50);
              fr2.setVisible(true);
              fr2.setOpaque(false);
              fr2.setBackground(new Color(0,0,255,140));
         JPanel panel2 = new JPanel();
         panel2.setLayout(new BorderLayout(0, 0));
              fr2.add(panel2);
              desktop.add(fr2);
              //f.getContentPane().add(desktop);
              f.add(desktop);
         }

    guess what I have fixed it myself, this was the problem label.setPreferredSize(new Dimension(34,100)); wrong size, but I change it to 34, 50 and its work

  • How do I put two centered text in a PAGE_START in BorderLayout ?

    Hi everybody.
    I am using a BorderLayout and in PAGE_START section I want to put a title(centered, with two rows). I don't know how to do that. When I put my text there, is on the left side.
    Thanks.
    Edited by: blackblack13 on Jul 18, 2009 1:08 AM

    Aaa yes, you're right. The thing with two JLabels is very good, I didn't think about that. But with HTML I don't know how to use it. Where can I find smth about that?
    Thanks a lot !

  • Maximum size for JPanel in BorderLayout

    I'am using a BorderLayout in my JFrame. I want to place a JPanel in BorderLayout.CENTER. The problem: It should use the maximum possible space.
    For example, if I place a JButton in CENTER, the JButton will grow very big. I want the same behaviour for a JPanel.
    Using setPreferredSize doesn't seem to be a solution because I want the JPanel to resize dynamically, like a JButton does.
    Any ideas? :-)
    Thanks

    The borderlayout is the layout which resizes the components as and when the frame is resized. So i think you should not have a problem like resizing.
    One more thing when u are adding a panel with a borderlayout, do specify where the components are to be added on the panel. i.e. on north, center or south,etc...
    May be this simple example help u out, just copy paste the code and run it.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class BorderMain extends JFrame {
    Container c;
    JPanel pnl;
    BorderLayout bl;
    public BorderMain()
         setPreferredSize(new Dimension(200,200));
         c = getContentPane();
         bl = new BorderLayout();
         pnl = new JPanel();
         pnl.setLayout(bl);
         pnl.setBackground(Color.GRAY);
         c.add(pnl);
         c.validate();
         setVisible(true);
         pack();
         public static void main(String[] args) {
              new BorderMain();
    now when u add anythin to the panel just say
    pnl.add(new JButton("OK"), BorderLayout.NORTH);
    pnl.add(new JButton("OK"), BorderLayout.CENTER);
    pnl.add(new JButton("OK"), BorderLayout.SOUTH);
    this is just an example.
    if u add anything only to north, then to the panel will occupy all the space given.
    Regards
    Poonam.
    and if ur adding another panel on a panel with the borderlayout then u need to set the same layoutfor the inner panel also.

  • Keyboard shortcuts in JTabbedPane don't work in BorderLayout

    I'm mystified by a problem that doesn't seem to make any sense. I have a JTabbedPane with mnemonics, that used to work well before. But since I've shuffled components around a bit and put the JTabbedPane in the BorderLayout.CENTER of a JPanel, the keyboard shortcuts no longer work.
    The appropriate letters are underlined, but the Alt+letter sequence no longer switched tabs. Other components (JButtons) with keyboard shortcuts in the same JPanel, but in the BorderLayout.SOUTH or elsewhere, work as expected.
    It sounds like a bug to me, but is there perhaps a workaround?
    Thanks,
    - Peter

    I keep replying to my own posts...
    I figured out that the tabs start working once a component in them (say, a JTextField) receives keyboard focus. It does sound a bit suspicious to me, but I can live with it.
    Unfortunately, setting the focus programmatically doesn't seem to work: requestFocus() or requestFocusInWindow() on the first JTestBox simply don't work.
    - Peter

  • Set the minimal size of a Component with BorderLayout

    Hi,
    I got a little problem using BorderLayout.
    The scenario is :
    A JPanel placed BorderLayout.WEST got a size a few pixel too small for a JTable contained in this panel to paint all names of the table header.
    If i set the preferredScrollableViewportSize larger then a specific amount the table disappear(shrinks to a tiny size)
    The panel uses GridBagLayout...
    How can i set the size of this "west"-component of the border layout a little larger?
    regards
    Olek

    My understanding of help is an other then only post messages likeWell, your understanding, in my opinion is wrong.
    You must post a self documenting program ...Not everybody who uses this forum speaks english as their main language. Even if english is your main language it is not always easy to communicate the problem effectively. By posting demo code we can see exactly what you are doing.
    Or why you don't read the API... Of course that is a valid answer. You should always read the API. Why should we waste time typing the Documentation from the API when we can point you directly to the API????????
    why you don't search the forum Again, why should be waste time answering questions that have already been answered???????
    You learn by searching the forum and finding multiple solutions, then you use the solution that is appropriate. There is rarely a single solution for all cases. The more knowledge you have the better decision you can make.
    Have a little pride and learn to do some problem solving on your own without us spoonfeeding every anser to you.
    It is not possible to post a short self documenting program ...Then you truly don't understand what the problem is. And if you don't understand what the problem is how to you expect to communicate that problem verbally so that we understand the problem. You question is not about logic its about sizing of components. How hard is it to create a component and add it to a panel to demonstrate the problem. You don't even need real data. For example you can create a JTable with a single line of code, JTable table = new JTable(5, 10).
    the core of the problem depends on the components added to the JSplitPane...Then demonstrate that with a SSCCE.

  • Resizing JButtons in a BorderLayout

    Hi, I've been working with a BorderLayout and whenever I try and set a JButton's size or preferredSize, it always ignores what I set it at and puts it's size as filling the entire BorderLayout.CENTER. Any ideas?

    {color:#507C9A}1. In future, post Swing questions in the Swing forum: http://forum.java.sun.com/forum.jspa?forumID=57
    2. The behaviour of a Borderlayout is to ignore a component's preferredSize and stretch it to fill the centre.
    Solution: nest.
    JPanel withBorderLayout = ...
    JButton btn = ...
    //withBorderLayout .add(btn, BorderLayout.CENTER);
    JPanel centrePanel = new JPanel(); //FlowLayout by default, you may want to change this
    centrePanel .add(btn);
    withBorderLayout .add(centrePanel , BorderLayout.CENTER);{color}

  • HELP, HELP, HELP, Problems using GridBagLayout with BorderLayout

    I have a BorderLayout for my application. I created a JPanel that has the following items added to it:
    1)Button
    2)VisualComponent
    3)ControllerComponent
    The JPanel is then added to the WEST Pane of the BorderLayout. My problem is that I can not get my components in the JPanel to display correctly. The items should be added from top to buttom in my JPanel, but they overlap and display side by side, and some don't appear at all until my entire window application is Maximized. It seems as if all my components are trying to display in one row even though I explicitly add them to different rows as follows:
    1)addUsingGBL(openFile,0,1,2,1);
    2)addUsingGBL(visualComponent,1,1,1,3);
    3)addUsingGBL(controlsComponent,4,1,2,1);
    where addUsingGBL is as follows:
    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc. gridx = row;
    gbc.gridy = column;
    gbc.gridwidth = width;
    gbc.gridheight = height;
    gbLayout.setConstraints(component, gbc);
    mediaPanel.add(component);
    mediaPanel.doLayout();
    If anyone has any suggestions, I would greatly appreciate it. Entire code is available if needed. Thanks!

    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc. gridx = row;
    gbc.gridy = column;
    gbc.gridwidth = width;
    gbc.gridheight = height;
    gbLayout.setConstraints(component, gbc);
    mediaPanel.add(component);
    mediaPanel.doLayout();
    }I see that the problem is that you are using the same gridbagconstraints reference to add all your components. In effect, all your components refer to the same gridbagconstraints , you are getting all the components on a single row. The solution to this is simple - Try this out and tell me whether that works...
    void addUsingGBL(Component component,int row, int column, int width, int height)
    //Add this line in the beginning...
    gbc = new GridBagConstraints();
    gbc. gridx = row;
    gbc.gridy = column;
    gbc.gridwidth = width;
    gbc.gridheight = height;
    gbLayout.setConstraints(component, gbc);
    mediaPanel.add(component);
    mediaPanel.doLayout();

  • HELP, HELP, HELP, Problems using GridBagLayout with a BorderLayout

    I have a BorderLayout for my application. I created a JPanel that has the following items added to it:
    1)Button
    2)VisualComponent
    3)ControllerComponent
    The JPanel is then added to the WEST Pane of the BorderLayout. My problem is that I can not get my components in the JPanel to display correctly. The items should be added from top to buttom in my JPanel, but they overlap and display side by side, and some don't appear at all until my entire window application is Maximized. It seems as if all my components are trying to display in one row even though I explicitly add them to different rows as follows:
    1)addUsingGBL(openFile,0,1,2,1);
    2)addUsingGBL(visualComponent,1,1,1,3);
    3)addUsingGBL(controlsComponent,4,1,2,1);
    where addUsingGBL is as follows:
    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc. gridx = row;
         gbc.gridy = column;
         gbc.gridwidth = width;
         gbc.gridheight = height;
         gbLayout.setConstraints(component, gbc);
         mediaPanel.add(component);
         mediaPanel.doLayout();
    If anyone has any suggestions, I would greatly appreciate it. Entire code is available if needed. Thanks!

    Here is the code, sorry, didn't see that part before.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.media.*;
    public class MediaPlayerDemo extends JFrame /*implements ControllerListener*/{
    private Player player;
    private File file;
    public static JPanel mediaPanel;
    public static JScrollPane scrollableMediaPanel;
    //public static JFrame navigation = new JFrame("Lessons");
    public static Component visualComponent;
    public static Component controlsComponent;
    private static ImageIcon background = new ImageIcon("c:/Tony.jpg");
    public static GridBagConstraints gbc;
    public static GridBagLayout gbLayout;
    //public static panel column;
    //public static Container c;
    // inner class to handler events from media player
    private class EventHandler implements ControllerListener
         public void controllerUpdate( ControllerEvent e )
              if ( e instanceof EndOfMediaEvent)
              //if ( player == null )
              //return;
              player.close();
              //if ( visualComponent != null )
              mediaPanel.remove( visualComponent );
              //if ( controlsComponent != null )
              mediaPanel.remove( controlsComponent );
              mediaPanel.doLayout();
              // doLayout();
              if ( e instanceof RealizeCompleteEvent )
                   //c = getContentPane();
                   // load Visual and Control components if they exist
                   visualComponent =
                   player.getVisualComponent();
                   //visualComponent.setSize(5,5);
                   mediaPanel.doLayout();
                   //**Sets the layout for mediaPanel as GridLayout**
                   //**GridLayouts set the rows and col, **
                   //**& adds contentslt to rt **
                   //scrollableMediaPanel= new JScrollPane(mediaPanel);
                   //scrollableMediaPanel= new JScrollPane(mediaPanel);
                   gbc.weightx = 0;
                   gbc.weighty = 0;
                   gbc.fill = GridBagConstraints.NONE;
                   if ( visualComponent != null )
                   //add comp #2
                   addUsingGBL(visualComponent,1,1,1,3);
                   controlsComponent =
                   player.getControlPanelComponent();
                   if ( controlsComponent != null )
                   //add comp #3
                   //mediaPanel.add(controlsComponent);
                   addUsingGBL(controlsComponent,1,1,1,3);
                   controlsComponent =
                   player.getControlPanelComponent();
                   /*if ( controlsComponent != null )
                   //add comp #3
                   addUsingGBL(controlsComponent,4,1,2,1);
              doLayout();//after all components are added, you must redo your layout
              //**The following is for adding the a container only **
              //**getContentPane().add(mediaPanel,BorderLayout.WEST);**
              //**getContenPane().doLayout(); **
              //**setSize(200,700);//(width, Height) **
              //**show(); **
              }//if
         }//controllerUpdate
    }//eventHandler
    public MediaPlayerDemo()
         //**Title for a container **
         //**super( "Demonstrating the Java Media Player" );**
         mediaPanel = new panelBack(background);//instantiate JPanel Object
         gbLayout = new GridBagLayout();
         mediaPanel.setAlignmentY(TOP_ALIGNMENT);
         mediaPanel.setLayout(gbLayout);
                   gbc = new GridBagConstraints();
                   gbc.fill = GridBagConstraints.NONE;
                   //gbc.anchor = GridBagConstraints.NONE;
         //instatiate JButton object
         JButton openFile = new JButton( "Open file to play" );
         //openFile.setBounds(0, 0, 25, 25);
         //openFile.setVisible(true);
         //JBUTTON ActionListener
         openFile.addActionListener
              new ActionListener()
                   public void actionPerformed( ActionEvent e )
                   openFile();
                   createPlayer();
         );//addActionListener
         //add comp #1
         addUsingGBL(openFile,0,1,2,1);
         //set scrollPane
         scrollableMediaPanel = new JScrollPane(mediaPanel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                   JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );
         //Set Border
         scrollableMediaPanel.setViewportBorder(new BevelBorder(BevelBorder.RAISED));
    }//Constructor
    private void createPlayer()
         if ( file == null )
              return;
         removePreviousPlayer();
         try
              // create a new player and add listener
              player = Manager.createPlayer( file.toURL() );
              player.addControllerListener( new EventHandler() );
              player.start(); // start player
         catch ( Exception e )
              JOptionPane.showMessageDialog( this,
                   "Invalid file or location", "Error loading file",
                   JOptionPane.ERROR_MESSAGE );
    //Main only useful if creating a container to hold menuPanel
    public static void main(String args[])
         MediaPlayerDemo app = new MediaPlayerDemo();
         app.getContentPane().setLayout(new BorderLayout(0,0));
              app.getContentPane().setBackground(Color.white);
              app.getContentPane().add(scrollableMediaPanel, BorderLayout.WEST);
         app.getContentPane().validate();//re-layout a container for which the layout has changed
         app.setSize(1000,700);//(width, height)
         app.show();
         app.addWindowListener
              new WindowAdapter()
                   public void windowClosing( WindowEvent e )
                   System.exit(0);
    private void openFile()
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(
              JFileChooser.FILES_ONLY );
         int result = fileChooser.showOpenDialog( this );
         // user clicked Cancel button on dialog
         if ( result == JFileChooser.CANCEL_OPTION )
              file = null;
         else
              file = fileChooser.getSelectedFile();
    private void removePreviousPlayer()
         if ( player == null )
              return;
         player.close();
         if ( visualComponent != null )
              mediaPanel.remove( visualComponent );
         if ( controlsComponent != null )
              mediaPanel.remove( controlsComponent );
         //set background for the JPanel
         public class panelBack extends JPanel
              ImageIcon image;
              panelBack(ImageIcon image)
                   super();
                   this.image=image;
              public void paintComponent(Graphics g)
                   image.paintIcon(this,g,0, 0);
         }//panelback
    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc = new GridBagConstraints();
         gbc. gridx = row;
         gbc.gridy = column;
         gbc.gridwidth = width;
         gbc.gridheight = height;
         gbLayout.setConstraints(component, gbc);
         mediaPanel.add(component);
         mediaPanel.doLayout();
    }//MediaPlayerDemo

  • How can I know the size of a JViewport laid out in BorderLayout.CENTER?

    I have a JPanel inside a JScrollPane. The scroll pane is laid out inside of BorderLayout.CENTER. I need to know the size of the JViewport to do stuff like centering and zooming.
    Where can I find the size? All these methods return 0 values for X and Y:
    myScrollPane.getViewport().getSize()
    myScrollPane().getSize()
    myScrollPane.getHorizontalScrollbar().getValue()
    Yes, even the scrollbars won't give me any values! It's all because of the BorderLayout!
    Any ideas? Thanks.

    Sounds like you are accessing the sizes before the views are realized (that is before a call to frame.pack()/show()) They are available only after the layoutManager had a go on it. What is available earlier are preferred/min/max, though.
    Greetings
    Jeanette

  • Layout, similar to borderlayout

    Hi guys.
    i have search but i cant seem to find on. i would like to make a layout similar to BorderLayout.
    but with instead of resizing the components it just move them around.
    it is mainly for positioning componts on the screen. Alot of times i want to add a components to the BottemLeft hand side of the screen and want it aligned there permentaly.
    there should be 8 places to add components
    1            2              3
    4            5              6
    7            8              9and if you add componnet to the screen with the giving number, it should align the item there.
    Does any one have some code like this? or know of a layoutManager that does it?
    I could use 3 panels and borderLayout on each, but BorderLayout RESIZES compoments and i want something that doesnt
    if not... the o well,

    unles your nested panels use BorderLayout too... :-) By default JPanel uses a FlowLayout which will respect the preferred size of the component you add to it. So you add your compoent to a panel using a FlowLayout, then add then panel to a secon panel that is using the BorderLayout.

  • BorderLayout in javafx

    Hey,
    I need smth like BorderLayout from swing in javafx, but much simpler (only North and Center).
    I used Vbox layout on scene with binding width and height values with scene size for autosizing all content inside scene.
    First, in VBox I put ToolBar Control. This control fill space horizontally and it is good (like NORTH behaviiour)
    But I want all other space was filling by other control eg Button.
    I experimented with layoutInfo for Button, attributes: hfill=true, vfill=true, but control filled space only horizontally, not vertically.
    How can i do this?
    Ps.
    Step 2 If I do this I want replace Button with Rectangle. Rectangle is not resizable so it's other story (jfxtras has ResizableRectangle)
    Step 3 Then I want put this rectangle into Group as background (with linear gradient)
    Step 4 Then I want put in Group, HBox and then put inside TreeView and other container.
    In swing world it will be:
    * Panel (BorderLayout):
    ******** NORTH: Toolbar
    ******** CENTER: Panel (BorderLayout) with background
    ****************** WEST: TreeView
    ****************** CENTER: Panel (...)
    How can I get result as above in JavaFX?
    Every clues will be important for me.
    Ps. Many chaotic steps because i was trying experiment with javafx to understand how it works.
    Thanks for advices.
    Edited by: rafik7777 on May 12, 2010 11:04 AM

    See [A JavaFX 1.3 Custom Layout Example|http://learnjavafx.typepad.com/weblog/2010/05/a-javafx-13-custom-layout-example.html] article.
    Also of interest: MiGLayout, implemented in JFXtras (coming soon to support 1.3).

  • A few questions regarding BorderLayout, JTabbedPane and JFrame.

    Hello,
    I'm after a little help. I want to know the following:
    1)
    How to you add a gap on the far left and far right so that the components at PAGE_START and PAGE_END when using BorderLayout have visible borders. I have tried the Constructor which lets you specific hGap and vGap but this does not work, I assume it is only when butting components together.
    2)
    When using JTabbedPanes with option
    setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT );is there a way to control painting of the Scroller which scrolls through the tabs? I am currently using a custom UI (subclassing BasicTabbedPaneUI) to paint my tabs however I can not work out how to paint the Scroller.
    3)
    How to I add a custom JFrame Border and remove the blue XP border? Do I need to setUndectored and add my own Icons? I want to achieve something along the lines of what you can see here
    https://substance.dev.java.net/images/screenshots/themes/skins/business1.png
    I will be using a custom L&F although not Substance and currently my L&F does not paint the border/Decorations on the Frame.
    Here is a picture of my app, outlining my problems.
    http://img91.imageshack.us/my.php?image=exampletz1.jpg
    A nudge in the right direction on any of these would be great.
    Thanks

    Hello,
    I'm after a little help. I want to know the
    following:
    1)
    How to you add a gap on the far left and far right so
    that the components at PAGE_START and PAGE_END when
    using BorderLayout have visible borders. I have
    tried the Constructor which lets you specific hGap
    and vGap but this does not work, I assume it is only
    when butting components together. agree vgap and hgap increase the vertical and horizontal distances between objects added to the panel that uses border layout.
    Why not do setBorder(BorderFactory.createEmptyBorder(.....) to do this for you?

  • How to set components aligned in left when we use BorderLayout

    Hello All,
    How to set the components aligned in the left when we use BorderLayout in a panel.Right now,the components are getting aligned in the center.
    Any solutions?
    Thanks in advance,
    Vijay

    By default a JPanel uses a FlowLayout when created and by default a FlowLayout uses center alignment. Read the FlowLayout API to find out how to use left alignment.
    Also each individual component has an alignmentX and alignmentY value which is set to 0.5 (center aligned). Some LayoutManagers will take this value into consideration. Read the Component API for more information.
    Also, check out this section from the Swing tutorial on "Using Layout Managers":
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

Maybe you are looking for

  • 2nd Class not displaying in applet on browser

    I have a very basic applet that consists of two classes, the applet itself and a gui component class that I created that is used in the applet. When I run it in the AppletViewer, I can see my gui component on the applet just fine. But when I try to r

  • Mac 'n' windows partitioning

    Hey all, ok i've gone and done something a little rude and put windows xp on my mac (leopard) when i installed windows i partitioned 5% of my hardrive now i wish to patition a little more 10 - 15% how do i go about doing this? thanx.

  • EDI 850 Mapping Clarification

    Hello, I have a requirement to Post EDI 850 Document to create Sales Orders in SAP. Currently, we are working on finalizing the mapping Document with the all the required fields that will be sent by the Customer. Now, the query that the EDI Contact h

  • What are the steps to downlaod video from youtube?

    i wish to downlaod movies from youtube site but couldn't due to i am new on firefox website.

  • Only the first of multiple cutaways show (PNGs)

    I'm trying to overlay one PNG at a time across a timeline, using the "cutaway" feature. But only the first PNG appears, and then iMovie ignores the rest during playback. All the PNGs have transparency.  Any ideas what might be happening?  I'm using t