Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

after authentication the new frame is NULL ???  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my application the end user supposes to autheticate himself.
when he does I'm invoking a new frame(success) that shows the message "authenticatio correct" and then it brings the (actual) application to screen.

Problem: the success frame is blank!!! NOTHNIG init (no colors, no text)

//user has authenticate himself
// show success frame

JFrame successFrame = new JFrame();
successFrame.setSize(330, 20);
successFrame.setTitle("Login Correct... please wait");
Toolkit kit = successFrame.getToolkit();
Dimension screenSize = kit.getScreenSize();
int screenWidth = screenSize.width;
int screenHeight = screenSize.height;
Dimension windowSize = successFrame.getSize();
int windowWidth = windowSize.width;
int windowHeight = windowSize.height;
int upperLeftX = (screenWidth - windowWidth)/2;
int upperLeftY = (screenHeight - windowHeight)/2;
successFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
successFrame.setLocation(upperLeftX, upperLeftY);

JPanel p = new JPanel();
p.add(new JLabel("username has been authenticated\n"));
p.add(new JLabel("Please wait..."));
p.setBackground(Color.getHSBColor(0.0f, 0.3f, 0.69f));
successFrame.getContentPane().add(p);
successFrame.show();


//dispose success frame
//invoice actual frame


anyone???
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just ran your code and the JFrame showed up; but only the titlebar. This may be the problem
successFrame.setSize(330, 20);
The height is 20.
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the code runs good when you invoke it from the main. the problem is in between the authentication and the actual program.

the .setSize(330, 20); is just temp.

it suppose to be setSize(330, 20)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!