• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame Issues

 
Seany Collins
Greenhorn
Posts: 4
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone have a look at my code and figure out what i cannot as to why the JFrame is not working please, im a beginner so go easy on me

 
fred rosenberger
lowercase baba
Bartender
Posts: 12340
38
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "Not working"? Does it compile? Does it run? Does it crash? Does it display something you don't want (or not display something you do want)?
 
Seany Collins
Greenhorn
Posts: 4
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:What do you mean by "Not working"? Does it compile? Does it run? Does it crash? Does it display something you don't want (or not display something you do want)?


Sorry i should have been more specific , I cannot figure out why the JFrame will not appear with all the components in it, nothing appears when i compile.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12340
38
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing should appear when you compile. you have to run it. We can't do that, because we don't have your database.

It is also extremely hard to look at 500 lines of code and figure out anything. Is there any way you can trim this down to the bare minimum needed that shows your problem? Ideally you would give us code that we can cut-and-paste into an editor, save the file, then compile and run it.

generally speaking, I would suggest you never write more than 2-3 lines of code before compiling and testing. Writing a file with 500+ before you test it will only bring you pain.
 
Seany Collins
Greenhorn
Posts: 4
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:Nothing should appear when you compile. you have to run it. We can't do that, because we don't have your database.

It is also extremely hard to look at 500 lines of code and figure out anything. Is there any way you can trim this down to the bare minimum needed that shows your problem? Ideally you would give us code that we can cut-and-paste into an editor, save the file, then compile and run it.

generally speaking, I would suggest you never write more than 2-3 lines of code before compiling and testing. Writing a file with 500+ before you test it will only bring you pain.


Problem is this is a project due in soon, It has to be the content pane that is the problem, i would love to give you my SQL file if possible?
 
K. Tsang
Bartender
Posts: 3604
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even when you run it as is, there will be no components in the JFrame because you haven't called those other methods!

Also your constructor initializes the DB connection and stuff. But your query ISN'T a query (it's a URL). So the program should immediately exit.

I noticed your DB credentials (user/password) are constants yet you are expecting user to pass them into the program. I believe those constants will be removed just using the parameters.
 
Seany Collins
Greenhorn
Posts: 4
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K. Tsang wrote:Even when you run it as is, there will be no components in the JFrame because you haven't called those other methods!

Also your constructor initializes the DB connection and stuff. But your query ISN'T a query (it's a URL). So the program should immediately exit.

I noticed your DB credentials (user/password) are constants yet you are expecting user to pass them into the program. I believe those constants will be removed just using the parameters.


I may have a breakthrough, im re-writing a load of stuff, i'll will get back to you soon
 
Campbell Ritchie
Marshal
Posts: 52516
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope it's not to late to welcome you to the Ranch

Please always tell everybody when you post on multiple sites; that applies to the people on javaprogrammingforums too.
Never write so much code and try to get it to run. If you write even ten lines before compiling again and looking for errors, you are making a rod for your own back because you may get dozens of errors or more and not know how to sort them out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!