Welcome to Dream.In.Code
Become a Java Expert!

Join 150,138 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,266 people online right now. Registration is fast and FREE... Join Now!




Net Beans 5.5 beyond stress!

 
Reply to this topicStart new topic

Net Beans 5.5 beyond stress!, 3 Weeks encounting

Ak-Emm
22 Aug, 2008 - 09:49 AM
Post #1

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 22



Thanked: 1 times
My Contributions
Emergency

Deadline is in a few days i need to crack this menace

ive tried all methods see last post "Help withNetBean5.5"

why cant this just be like Pascal ?
but well the screenshots are shown below as examples to give you an idea of what i mean

ive clicked on the button(Arithmetic) from the Main J-frame which it is to open the second j-frame either nothing happens, the whole window dissapears or i get errors

in the example below J-frame 2 (grades) should be displayed after you click on the grades button

this is all in one Class file (package) a bundle of individual sub-frames and a Main j-frame (Main Window where sub-frames are called)


action perfrormed or mouse clicked should open second j-frame in main window while main-jframe is invisble this should apply back and fro

both are the attempts done
any suggestions to correct this?

This post has been edited by Ak-Emm: 22 Aug, 2008 - 10:04 AM


Attached thumbnail(s)
Attached Image Attached Image Attached Image Attached Image Attached Image
User is offlineProfile CardPM
+Quote Post

JeroenFM
RE: Net Beans 5.5 Beyond Stress!
22 Aug, 2008 - 12:08 PM
Post #2

D.I.C Head
Group Icon

Joined: 30 Jun, 2008
Posts: 191



Thanked: 9 times
Dream Kudos: 100
My Contributions
Why exactly are you making a new post for this?

As for your screenshots:

Top left
There is no class called JFrame2. You are creating an object of class JFrame, so remove the 2. If you can't understand why I suggest you research the difference between an object and class.

Top middle
You're saying: create a new window but keep it hidden, then throw the current window away.
User is offlineProfile CardPM
+Quote Post

nick2price
RE: Net Beans 5.5 Beyond Stress!
22 Aug, 2008 - 01:58 PM
Post #3

D.I.C Regular
***

Joined: 23 Nov, 2007
Posts: 338



Thanked: 12 times
My Contributions
You said in your first posting on this topic that you didnt want to use a JDialog for your son classes as you wanted to carry out mathematical operations? Why would a JDiaolog stop you from doing this? I have just created a whole JDBC application with only 2 JFrame classes (which is 1 more than i wanted), and 23 JDialog classes. This way you have an easy base on which to create a relationship between your JFrame and dialogs. Its bad practice to have multiple JFrames in one application. Anyway, really, your mathematical operations should be seperated from your gui.
User is offlineProfile CardPM
+Quote Post

JeroenFM
RE: Net Beans 5.5 Beyond Stress!
22 Aug, 2008 - 02:17 PM
Post #4

D.I.C Head
Group Icon

Joined: 30 Jun, 2008
Posts: 191



Thanked: 9 times
Dream Kudos: 100
My Contributions
QUOTE
why cant this just be like Pascal ?


Because Java is not Pascal, and since I am someone who has worked with Delphi and hated the experience, I think I understand your trouble.

I think your main problem is the fact that you don't really want to switch - which is hampering your ability to use the Swing framework.

Stop using the Netbeans GUI builder and do things manually - you're trying to glue stuff together the standard Delphi way which only makes it harder - and in my opinion not that much clearer.

So:

- To show a window, create an instance of a JFrame or JDialog, and make it visible. You can use 1 instance for your whole program (sort of like Delphi does it) and just hide and show it as needed.
- To make a button respond to something, add an ActionListener to it
- Don't confuse object and class names

This post has been edited by JeroenFM: 22 Aug, 2008 - 02:18 PM
User is offlineProfile CardPM
+Quote Post

nick2price
RE: Net Beans 5.5 Beyond Stress!
22 Aug, 2008 - 02:32 PM
Post #5

D.I.C Regular
***

Joined: 23 Nov, 2007
Posts: 338



Thanked: 12 times
My Contributions
And in response to JeroenFM's last post, i started swing by manually coding it myself, which was hard at first but got easier with time. I then thought i would try and save time by using netbeans to produce my gui and learning from the outputted code. When i saw the code which was outputted, i was shocked by how confusing it came out. In my opinion it produces alot of unneeded code and tottaly overcomplicates everything, to which someone new to the language could have no chance of possibly learning from.
Alot of people find swing difficult, but if you learn about the basic principles it becomes so much easier. By this i mean learning what a JFrame actually is and its purpose, what is a content pane, why we have layout managers, how to place JPanels on the content pane with layout managers and then use layout managers to place components on these JPanels. Learn this and you will be a pro.
User is offlineProfile CardPM
+Quote Post

Ak-Emm
RE: Net Beans 5.5 Beyond Stress!
23 Aug, 2008 - 12:27 PM
Post #6

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 22



Thanked: 1 times
My Contributions
QUOTE(nick2price @ 22 Aug, 2008 - 03:32 PM) *

And in response to JeroenFM's last post, i started swing by manually coding it myself, which was hard at first but got easier with time. I then thought i would try and save time by using netbeans to produce my gui and learning from the outputted code. When i saw the code which was outputted, i was shocked by how confusing it came out. In my opinion it produces alot of unneeded code and tottaly overcomplicates everything, to which someone new to the language could have no chance of possibly learning from.
Alot of people find swing difficult, but if you learn about the basic principles it becomes so much easier. By this i mean learning what a JFrame actually is and its purpose, what is a content pane, why we have layout managers, how to place JPanels on the content pane with layout managers and then use layout managers to place components on these JPanels. Learn this and you will be a pro.



Thanks guys for your efforts i really appreciate your expertise

which you are all correct rather than stressing out about a single package ive decided to create seperate packages that could be called later at a click of a button which seems to work if it means re-designing the whole GUI from scratch why not

Once again thanks to all
User is offlineProfile CardPM
+Quote Post

Ak-Emm
RE: Net Beans 5.5 Beyond Stress!
23 Aug, 2008 - 12:50 PM
Post #7

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 22



Thanked: 1 times
My Contributions
QUOTE(nick2price @ 22 Aug, 2008 - 02:58 PM) *

You said in your first posting on this topic that you didnt want to use a JDialog for your son classes as you wanted to carry out mathematical operations? Why would a JDiaolog stop you from doing this? I have just created a whole JDBC application with only 2 JFrame classes (which is 1 more than i wanted), and 23 JDialog classes. This way you have an easy base on which to create a relationship between your JFrame and dialogs. Its bad practice to have multiple JFrames in one application. Anyway, really, your mathematical operations should be seperated from your gui.



I really appreciate your time you take to help me sort out this issue

JFrame and J-dialog is not a bad idea although the example in Sun.java.com tutorial of how to create a dialog gives you errors when you try to follow that example thats why i didn't bother with dialogs
until i have mastered programing, dialogs is the next thing that i am going to implement in my project

i.e try use this tutorial set by Sun

JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");
you get an error somewhere saying does not recognise "frame,"

when you have set action performed or mouse clicked assigned to a button to display a dialogframe

ill see simpler ways to make this work




User is offlineProfile CardPM
+Quote Post

nick2price
RE: Net Beans 5.5 Beyond Stress!
23 Aug, 2008 - 01:01 PM
Post #8

D.I.C Regular
***

Joined: 23 Nov, 2007
Posts: 338



Thanked: 12 times
My Contributions
JDialogs are very simular to JFrames. I myself found the sun site quite difficult to follow at first. Thats why i looked elsewhere on the internet and found many good examples. if you do a search for somthing like java login dialogs, you can get some nice simple examples with only a few components.
User is offlineProfile CardPM
+Quote Post

Ak-Emm
RE: Net Beans 5.5 Beyond Stress!
23 Aug, 2008 - 01:09 PM
Post #9

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 22



Thanked: 1 times
My Contributions
QUOTE(nick2price @ 23 Aug, 2008 - 02:01 PM) *

JDialogs are very simular to JFrames. I myself found the sun site quite difficult to follow at first. Thats why i looked elsewhere on the internet and found many good examples. if you do a search for somthing like java login dialogs, you can get some nice simple examples with only a few components.


Thats true
like java tips if youve got any sites that are recomendable that would be helpful thanks
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 02:06AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month