Solved

Creating a MatrixLayout

Posted on 2004-07-30
11
203 Views
Last Modified: 2010-03-31
I would like to create a MatrixLayout which is capable to layout out components in a matrix manner.
For instance I want to layout let's say five panels. the MatrixLayout class should now layout the five panels depending on the size of the container, maybe three panels in on row and the remaining two panels in a second row. If the container will be resized the matrix should be rearranged so that maybe now there are four panels in the first row because the user extended the width of the container.

Could anyone provide me with appropriate source code?

Thank you,

Dirk
0
Comment
Question by:dirku
  • 3
  • 2
  • 2
  • +1
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 11676840
Use java.awt.GridLayout
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11676853
Actually you should look at GridbagLayout
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 63 total points
ID: 11676856
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 92

Assisted Solution

by:objects
objects earned 62 total points
ID: 11681712
> Could anyone provide me with appropriate source code?

Don't have any off hand but would be happy to help you with writing it :)

this should help get u started:
http://java.sun.com/docs/books/tutorial/uiswing/layout/custom.html
0
 
LVL 3

Expert Comment

by:JohnnyAffa
ID: 11687316
if youre going for something like that then i think youll need to use  a null layout and then rearrange them using you class's paint method. however, when your main container you need to determine what size they should be, ie a percentage of the available width, a fixed size ( if you resize and there is enough room add a panel from the bottom row to the top).

want example code?
0
 

Author Comment

by:dirku
ID: 11868856
Oha. Sorry for that. Have a lot of work to do! Please, don't clean up this topic, I want to continue on it.

objects, I would be happy to write such a Layoutmanager together with you. How should we start it?
0
 
LVL 92

Expert Comment

by:objects
ID: 11868868
> How should we start it?

read the tutorial I posted above :)
its fairly straight forward.
0
 

Author Comment

by:dirku
ID: 11919909
These answers aren't worth 125 points! Of course, I expected some source code as posted in my question but I dodn't get any! Thus, the question wasn't answered at all.
As objects suggested I wnated to build a MatrixLayout together with him but it would have been great to get a first part of the code to make a start easier for me. I am not the expert. I'm just the questioner needing some assistance.
For the time being I didn't get any help. Sorry, experts but I'm no step further than before. --> Nothing but expenses this time.

This is disappointing (but does not affect the great assistance I got many times before)!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
even odd program using while loop 3 40
jdbc error in jsp application 20 45
Desingning Refactoring existing code 2 24
CSV file parsing thru Java 13 31
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question