Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-2008, 12:27 AM
Member
 
Join Date: Jan 2008
Posts: 2
sjchase is on a distinguished road
Graphic settings being overridden?
I'm designing an app that lets the user select items from one list that can be moved to another list with add/remove buttons. That functionality works correctly, but when I try to set the size of the components or the panes they are in, the settings appear to be ignored. To group the components I have used nesting panes added to a tabbed panel. I've tried a few things so far, commented out in the code snippet. Being new to Java and Layout Managers in general, I'm hoping I missed something obvious. My questions are:
-how can I force the list boxes to be no bigger than a certain *maximum* size?
-why do none of the graphic overrides work, for the panes or for the components? (see attached screenshot)


The code that sets the graphical arrangement is as follows:

Code:
//add elements to respective panels //Dimension myMax=new Dimension(200,200);//doesn't work testPanel=new Panel(); agentPanel=new Panel(); runPanel=new Panel(); setupPanel=new Panel(); resultsPanel=new Panel(); configPanel=new Panel(); testPanel.setSize(300, 300); agentPanel.setSize(30,30);//doesn't do anything! GridBagLayout standardGrid=new GridBagLayout(); GridBagConstraints lpanelC=new GridBagConstraints();//left panel lpanelC.fill=GridBagConstraints.BOTH; lpanelC.weightx=0.5; lpanelC.weighty=1.0; lpanelC.gridx=0; lpanelC.gridy=0; GridBagConstraints rpanelC=new GridBagConstraints();//right panel rpanelC.fill=GridBagConstraints.BOTH; rpanelC.weightx=0.5; rpanelC.weighty=1.0; rpanelC.gridx=2; rpanelC.gridy=0; GridBagConstraints cboxC=new GridBagConstraints();//checkbox cboxC.weightx=0; cboxC.weighty=0; cboxC.gridx=1; cboxC.gridy=2; GridBagConstraints addBC=new GridBagConstraints();//add button addBC.weightx=0.5; addBC.weighty=1; addBC.gridx=1; addBC.gridy=0; addBC.insets = new Insets(0,10,0,10); GridBagConstraints removeBC=new GridBagConstraints();//remove button removeBC.weightx=0.5; removeBC.weighty=1; removeBC.gridx=1; removeBC.gridy=1; removeBC.insets = new Insets(0,10,0,10); testPanel.setLayout(standardGrid); testPanel.add(allTests,lpanelC); testPanel.add(addTests,addBC); testPanel.add(checkAllTests,cboxC); testPanel.add(myTests,rpanelC); testPanel.add(removeTests,removeBC); agentPanel.setLayout(standardGrid); agentPanel.add(allAgents,lpanelC); agentPanel.add(addAgents,addBC); agentPanel.add(checkAllAgents,cboxC); agentPanel.add(myAgents,rpanelC); agentPanel.add(removeAgents,removeBC); runPanel.setLayout(new FlowLayout()); runPanel.add(runButton); //Run Tests tab //allAgents.setMaximumSize(myMax);//this doesn't work //myAgents.setMaximumSize(myMax); frame.setSize(800, 800); setupPanel.setSize(800,800); setupPanel.add(testPanel); setupPanel.add(runPanel); setupPanel.add(agentPanel); //Config tab testFileLoc=new JTextField(testData); agentFileLoc=new JTextField(agentData); resultLoc=new JTextField(testLoc);; appInstructions=new JTextArea(blah); configPanel.add(testFileLoc); configPanel.add(agentFileLoc); configPanel.add(resultLoc); configPanel.add(appInstructions); configPanel.add(configButton); //Results tab frame.add(setupTab); setupTab.add(setupPanel,"Test Run Setup"); setupTab.add(configPanel,"Config"); setupTab.add(resultsPanel,"Results"); setupTab.setSize(800,800); frame.setVisible(true); frame.setResizable(true);
Thanks in advance!
Attached Images
File Type: jpg app.JPG (41.9 KB, 2 views)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Graphic jkswebsite Java 2D 6 11-26-2007 03:19 AM
JVM Heap memory settings nagesh New To Java 1 08-11-2007 11:17 PM
How do insert a Graphic carl New To Java 1 08-01-2007 06:30 AM
Detecting Browser Settings arupranjans JavaServer Pages (JSP) and JSTL 0 07-31-2007 03:31 PM
Swing Graphic interface Daniel AWT / Swing 2 06-28-2007 05:39 PM


All times are GMT +3. The time now is 08:15 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org