Solved

Creating a MatrixLayout

Posted on 2004-07-30
11
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unhandled exception type Exception 18 65
eclipse console opening separately 2 50
jmss example java 2 48
replace an existing file in Dropbox 1 8
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

752 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