layout-manager Questions

3

Solved

Is there a LayoutManager for Swing that acts as LinearLayout in Android? I like an idea of components weights very much.
Wilmerwilmette asked 23/2, 2012 at 8:32

7

I have a panel derived from JPanel. I have a custom control derived from JLabel. I am attempting to center this custom JLabel on my panel. The only way I know to do this that will work is to use t...
Sella asked 22/3, 2012 at 19:39

14

Solved

To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action...
Manumit asked 20/10, 2008 at 11:53

3

Solved

I have a JTabbedPane with 2 JPanels set to GridLayout(13, 11). The first JPanel has enough of the cells filled out that it leaves the empty cells. The second JPanel has significantly fewer cells...
Orange asked 2/2, 2014 at 20:50

5

Solved

This seems like it would be an easy solution, but it seems that setting private RecyclerView mRecyclerView; private RecyclerView.Adapter mAdapter; private LinearLayoutManager mLayoutManager; .......
Abirritate asked 31/12, 2014 at 23:54

3

So what I am trying to go for is having a staggered layout but the first item in the list needs to span two columns. The first two rows are also a fixed height. I have everything working except the...
Brana asked 11/12, 2014 at 16:24

5

Solved

The default behavior of a GridLayout is that the components are filled row by row, and from left to right. I wonder if I can use it so that the components are filled by columns (from left to right)...
Sulfapyrazine asked 30/6, 2011 at 12:31

3

Solved

How do I only change the width or height of a component that requires a Dimension object? Currently I do it like this: jbutton.setPreferredSize(new Dimension(button.getPreferredSize().width, 100))...
Leija asked 24/8, 2011 at 14:56

6

Solved

I just wrote a simple code where I want a textfield and a button to appear on the main frame, but after running all I see is the textfield. If I write the code of the button after the textfield th...
Oddfellow asked 28/12, 2011 at 20:12

3

I'm in a challenge to build a layout like this: My first insight was to use a RecyclerView with an adapter that can deal with each item and inflate its layout. So far, not so good. I got this ...

5

Is there any way or plug-in that disables Netbeans automatic component alignment? When I place a label, all my components got placed randomly on the panel, not how I set them up. Every time I add a...
Kaiak asked 28/12, 2011 at 18:3

9

Solved

Several times I've been criticized for having suggested the use of the following methods: setPreferredSize() setMinimumSize() setMaximumSize() on Swing components. I don't see any alternatives to...
Shipway asked 29/8, 2011 at 11:2

2

Solved

I have a Staggered grid containing 370 items, with images. I want to make sure the items are recycled quickly to be careful with memory, but a ViewHolder is created and then bound for every singl...

6

Solved

A GUI with no white space appears 'crowded'. How can I provide white space without resorting to explicitly setting the position or size of components?­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­...
Blighter asked 26/7, 2013 at 6:50

5

Solved

I am a starting Java developer, learning just from internet tutorials. I am learning full-screen GUI applications. I was told yesterday that I shouldn't use AWT in my programs because it is outdate...
Ai asked 6/6, 2011 at 16:28

2

Solved

I need to position a JLabel over some JButtons, vertically, like a game menu. They should all be centered. I already downloaded MigLayout, but I'm not sure how to use that, so I just want a way to ...
Traffic asked 21/1, 2012 at 5:19

1

Solved

I have a JPanel with Constraint's of Y_Axis so that whenever I add a new Component it will automatically be Added on a new Line.But the Problem is that the Label inside is not Aligned to Left or Ri...
Knotted asked 16/9, 2017 at 16:23

4

Solved

I am trying to have several JTextFields on a single row, but I don't want them to have the same width. How can I control the width and make some of them wider than others? I want that they together...
Brevity asked 24/5, 2010 at 13:59

1

In my application I want show some RecyclerViews. I want show 3 item in one row, I my application should use 4 recyclerView because each recyclerVews each data other API. In one of RecyclerView I ...
Cam asked 8/8, 2017 at 9:21

11

I want to add JTable into JPanel whose layout is null. JPanel contains other components. I have to add JTable at proper position.
Mohr asked 11/4, 2011 at 12:35

4

Solved

I've a window and since I dinamically change it's children (sometimes I swap JPanels), I found no other solution than calling pack() on the window to get the new element displayed. Otherwise it wil...
Airsickness asked 29/8, 2011 at 15:25

2

Solved

Inspired by this question JLayeredPane with a LayoutManager I'm trying to get the JLayeredPane to work with the GridBagLayout. Here's the custom LayeredPane-class: class StackConstraints { public ...
Seasonseasonable asked 23/2, 2017 at 10:49

3

Solved

I have initialized MotePanel, Command Panel and LEDPanel before setting their Layout, then how so am I getting this exception. Please help. Exception in thread "main" java.awt.AWTError: Box...
Static asked 6/5, 2011 at 21:6

1

I am adding components in JPanel which is set as FlowLayout, they are not moving on next line even there is no space in left in that line. Here is the screenshot of the problem import javax.swin...
Joanajoane asked 1/12, 2016 at 15:28

3

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 th...
Eggplant asked 16/2, 2012 at 17:26

© 2022 - 2024 — McMap. All rights reserved.