Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating a MatrixLayout

Posted on 2004-07-30
11
Medium Priority
?
230 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 252 total points
ID: 11676856
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 92

Assisted Solution

by:objects
objects earned 248 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

721 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