Results 1 to 8 of 8
- 08-28-2010, 02:21 PM #1
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
GridBagLayout is centerd and I cant change it :(
Hai!
I try to make my grid to start from the top of the JInternalWindow and
then when I add a row, then that row is added below all the other rows.
Now that doesnt happen!
All rows are centerd in the middle and if I add a line, it still makes em fit in the middle!!
I'v set:
the GridBagConstraints c
c.anchor = GridBagConstraints.NORTH;
Doesnt help.
c.fill = GridBagConstraints.NORTH;
doesnt help either..
What am I doing wrong?
-
I think that you'll need to show us more code, hopefully a small compilable and runnable bit of code, an SSCCE.
edit: also as far as I recollect, fill shouldn't be NORTH but rather HORIZONTAL, VERTICAL, BOTH, or NONE. Also, when I hear of things bunching up in the center of a GBL component, the first thing I think of is that the weights haven't been properly set. But again, we'll need to see what you're doing with all the constraints to know how to fully help you.
Best of luckLast edited by Fubarable; 08-28-2010 at 03:05 PM.
- 08-28-2010, 04:52 PM #3
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Okej.. Well, nvm that then..
Because my Gui is splitted and got LOADS of classes that would need to be combined..
I'm almoste lost in my own scripts :P
Well, the program is soon done so it doesnt mather..
BUT!
I would need help with this:
That method returns a string yes, but not the last typed in string!Java Code:public static String getString(String q){ String someString = JOptionPane.showInputDialog(q); return someString; }
Idk why but for some reason, I run this and it works.
Then I shutdown down and then use that function writing another string.
Then it returns the first string I wrote in the first debug test!
Idk why but I always get the value I typed the debugtest before!
Anyy ideas why?
T
-
OK, and hopefully this means that you've solved this issue, but if not and you're still stuck, all you would need to do is extract out the relevant parts into a small GUI that creates rows of components and adds a row on button push.
I don't know, as it works fine for me. I suspect that your error lies elsewhere in your code. Again, an SSCCE would greatly aid us in helping to solve this.BUT!
I would need help with this:
That method returns a string yes, but not the last typed in string!Java Code:public static String getString(String q){ String someString = JOptionPane.showInputDialog(q); return someString; }
Idk why but for some reason, I run this and it works.
Then I shutdown down and then use that function writing another string.
Then it returns the first string I wrote in the first debug test!
Idk why but I always get the value I typed the debugtest before!
Anyy ideas why?
T
Luck!
- 08-28-2010, 05:36 PM #5
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Okej, Ill do that if I cant find a solution soon enough.
But for the getString method error, I figured out thats not the problem.
The problem is here:
dbName = Database nameJava Code:Statement statement = conn.createStatement(); statement.execute("ALTER TABLE "+dbName+" ADD COLUMN "+ColumnName+" VARCHAR(30)");
Now what this is suppose to do is add a column.
It does, if you execute it twice :P
I think I might know why, but Dunno how to fix it..
I think I have to, sorta, reinitiate the database?
To get the Database I do this:
Something there that needs to be done again for each time I add a column?Java Code:public static SqlManager getDB(String name) throws ClassNotFoundException{ setDBSystemDir(); Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); Connection dbConnection = null; String strUrl = "jdbc:derby:DefaultAddressBook;create=true"; try { dbConnection = DriverManager.getConnection(strUrl); System.out.println("Got database"); createTables(dbConnection,name); } catch (SQLException ex) { ex.printStackTrace(); }
- 08-29-2010, 03:53 AM #6
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
-
- 08-29-2010, 03:57 AM #8
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
Similar Threads
-
[AWT] GridBagLayout Help.
By Sandia_man in forum AWT / SwingReplies: 2Last Post: 05-23-2010, 08:54 PM -
help with gridbaglayout
By robertbob in forum AWT / SwingReplies: 5Last Post: 05-18-2010, 04:14 AM -
GridBagLayout
By newtojava7 in forum New To JavaReplies: 2Last Post: 03-07-2008, 12:16 AM -
GridBagLayout...please help
By newtojava7 in forum Advanced JavaReplies: 1Last Post: 02-17-2008, 01:16 AM -
gridbaglayout
By newtojava7 in forum New To JavaReplies: 4Last Post: 01-27-2008, 08:03 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks