Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Re: Using GridLayout with Buttons  RSS feed

 
kalai arasan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am using GridLayout with Buttons,it is taking default size of the button either the Button's value is small or large.

I want to use whatever the Buttons should be Button value's length.


Is it possible in GridLayout.

I used FlowLayout, there was some issue on this so that i used GridLayout.

I am attaching the Screen shot as well as Expected Screen also.

Please provide me your valuable information.


With Regards,
Kalai.
withSpaceButtonsIssue.JPG
[Thumbnail for withSpaceButtonsIssue.JPG]
This is the screen i am getting
netst11a_allButtons.JPG
[Thumbnail for netst11a_allButtons.JPG]
Expected Result
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole point of a GridLayout is to have all the components the same size, so if that's not what you want then you definitely need to use a different layout manager. What were the problems with FlowLayout?

Though I would say, the version you're getting looks much neater than the version you want. That looks very untidy.
 
kalai arasan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Matthew,

thanks a lot for your response.

The problem was in FlowLayout, when we click on the panel ,buttons were realigned at very first time(after some clicks also its happening)

As per the functionality when the GUI opened at very first time,it will show all buttons(100 buttons) suddenly so many buttons disappear,

after that for example "MON" it is in first row second position.if we click on that it has to do perform some operation internally and it should keep in same position otherwise it should not display and some other button also should not display in that position.it is displaying by use of FlowLayout.


i am able to resolve those problems with use of GridLayout.


Expected :

1) It should not do any action while click on panel(it is realigning when we click at very first time after loaded GUI)
2) Buttons should not realign at any point of time.
3) When we click on any button at very first time ,it just realigned that should not happen.instead it has to perform some action.

4) Buttons are looks good with use of FlowLayout.

5) GridLayout takes more space front and back


Iif you have any doubt on this,
Please refer my screen shots which i attached earlier posst ,

With Regards,
Kalai.
 
Rob Camick
Ranch Hand
Posts: 2787
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is your code, not the FlowLayout.

A picture doesn't help. Post your SSCCE that demonstrates the problem.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do take out time to click on the link Rob provided to find out what SSCCE really means. Do not post ~800 lines of code like you did the last time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!