Questions tagged [border-layout]

BorderLayout is a Java Swing/AWT layout manager that lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center.

BorderLayout lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center. Each region may contain no more than one component, and is identified by a corresponding constant: NORTH, SOUTH, EAST, WEST, and CENTER.

Here is an example of five buttons in an applet laid out using the BorderLayout layout manager:

enter image description here

In addition, BorderLayout supports the relative positioning constants, PAGE_START, PAGE_END, LINE_START, and LINE_END. In a container whose ComponentOrientation is set to ComponentOrientation.LEFT_TO_RIGHT, these constants map to NORTH, SOUTH, WEST, and EAST, respectively.

enter image description here

Relevant documentation and tutorials:

432 questions
11
votes
3 answers

Very thin white border between cell of a table only on iPad

This happen only on iPad retina and non retina iOS 5 and 6. Even if I try to have no border on a table there is a thin white border that appear. You can see an example of the problem at http://codepen.io/anon/pen/Kcexq. A iPad or the simulator is…
tolbard
  • 1,273
  • 15
  • 20
8
votes
2 answers

How to put two components to a JPanel with BorderLayout?

What basically i'm trying to do is to add 2 pictures, Side-By-Side in the center of a JPanel and a JLabel to the right of the JPanel, So I was told to set the layout of the JPanel as BorderLayout and to add the pictures with BorderLayout.CENTER and…
Gilad
  • 237
  • 1
  • 3
  • 12
6
votes
3 answers

Java Swing: Changing border width/height on BorderLayout

I am a newbie to Java Swing. I am trying to make a frame containing three buttons; one in the center, another on the top, and the last one on the right. I want to make the NORTH and EAST borders the same width. But right now, the EAST border is…
ahab
  • 61
  • 1
  • 1
  • 2
6
votes
3 answers

JPanels don't completely stretch to occupy the available space

I have a panel where I place several mini-panels, side-by-side, with different sizes and colors, and they should occupy the entire parent panel (horizontally). For this I use BorderLayout (for the parent panel), and BoxLayout for a sub-panel where I…
Anoyz
  • 7,431
  • 3
  • 30
  • 35
6
votes
1 answer

R | ggplot2 | (remove tick marks + remove panel border) but keep axis lines

novice user here so please be kind and gentle! :) I am dealing with the following dataset and R script: #Create pvalue ranges pvalue <- c(".000 - .005",".005 - .010",".010 - .015",".015 - .020",".020 - .025",".025 - .030",".030 - .035",".035 -…
James F
  • 65
  • 1
  • 1
  • 5
6
votes
1 answer

How to disable dragging of JToolbar?

How to disable dragging of JToolbar? I placed it in a BorderLayout. I tried finding a method. Is there such a method ? THanks
Philip Morris
  • 459
  • 1
  • 9
  • 26
5
votes
2 answers

Keeping preferred sizes of components in center of BorderLayout

I have a medium-large UI that uses a BorderLayout; the center is a tabbed pane containing various panels with various layouts, etc. I want the panel in the center of this border layout to resize according to the size of the window, but I don't want…
arcy
  • 12,845
  • 12
  • 58
  • 103
5
votes
3 answers

BorderLayout not working

I cannot get BorderLayout to work. I want the cancelbutton to be positioned at the bottom, but it doesn't work. Code: import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import…
Tyilo
  • 28,998
  • 40
  • 113
  • 198
5
votes
3 answers

JProgressbar width using Grid/FlowLayout

I'm working on a downloader which looks like this at the moment: The JFrame uses a BorderLayout. In the NORTH, I have a JPanel(FlowLayout). In the SOUTH there is also a JPanel(FlowLayout), in the WEST I just have a JTextArea (in a JScrollPane).…
Matthias
  • 12,704
  • 13
  • 35
  • 56
5
votes
4 answers

css inner border, broken layout

I have divided the screen with many div so they stick one to each other (let say, something like chess-board, but with fields of variable sizes). I set heigth and width using percents (relative to parent container). Now, when I add border: 1px to…
Jakub M.
  • 32,471
  • 48
  • 110
  • 179
5
votes
2 answers

swing flowlayout preferredSize does not change automatically

I want to have a FlowLayout for MyPanel to add some arbitrary buttons. I added MyPanel into JFrame north ( JFrame has a BorderLayout). My problem is: When the buttons inside MyPanel occupy more than one row, they are not displayed. In other…
Dariush Jafari
  • 5,223
  • 7
  • 42
  • 71
5
votes
2 answers

Java Text Formatting bold

I am having a hard time understanding how to bold the text in my GUI program. The program shows the initial value of my calculator program to be 0.0 but I need to be able to make it bold and set it to 14 font. Is there any easy way to do…
YellowSoloCup
  • 101
  • 1
  • 4
  • 11
5
votes
2 answers

Can't change size of block in BorderLayout

I created simple app with Border Layout and added into it two buttons and JTable. I use JSplitPane between button2 and JTable. I would like redefine default size of block where is situated button1. How can I to solve this task? Here is my…
veinhorn
  • 2,363
  • 6
  • 21
  • 33
5
votes
1 answer

Collapsing nested borderlayout panel in anchorlayout panel in Ext.Viewport

I have a viewport with code Ext.define('WIMM.view.Viewport', { extend: 'Ext.container.Viewport', autoScroll: true, layout: 'anchor', items: [ { border: false, title: 'Header', layout: 'fit', xtype: 'container', …
vitalii-patsai
  • 361
  • 3
  • 7
5
votes
3 answers

Java BorderLayout stretch east

Is it possible to make the east (or west) side of a BorderLayout to spread over the entire panel (include north/south)?
Reinard
  • 3,624
  • 10
  • 43
  • 61
1
2 3
28 29