Solved

Creating a MatrixLayout

Posted on 2004-07-30
11
226 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

623 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