PDA

View Full Version : Java Gui Code Really Annoys Me



4th gen
03-22-2004, 11:14 PM
:angry: :angry: :angry: :angry: :angry:

Stupid bloody java GUI code :angry:

bigboab
03-22-2004, 11:15 PM
Originally posted by 4th gen@22 March 2004 - 23:14


:angry: :angry: :angry: :angry: :angry:

Stupid bloody java GUI code :angry:


Is that GUI or GVI?

4th gen
03-22-2004, 11:19 PM
Originally posted by bigboab@22 March 2004 - 22:15
Is that GUI or GVI?
GUI (Graphical User Interface)...

What is GVI?

benxuk
03-22-2004, 11:21 PM
why does it annoy you,

bigboab
03-22-2004, 11:23 PM
Originally posted by 4th gen+22 March 2004 - 23:19--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (4th gen @ 22 March 2004 - 23:19)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-bigboab@22 March 2004 - 22:15
Is that GUI or GVI?
GUI (Graphical User Interface)...

What is GVI? [/b][/quote]
I would have thought in this day and age it would be all drag and drop. No need for code.

4th gen
03-22-2004, 11:23 PM
Originally posted by benxuk@22 March 2004 - 22:21
why does it annoy you,
It&#39;s over-complicated. Have you ever used it?

bigboab
03-22-2004, 11:24 PM
GVI is just my bad eyesight. :lol:

benxuk
03-22-2004, 11:25 PM
thats kinda open questioned really? am i right in thinkin your using java and the project has a gui?

what you using?

4th gen
03-22-2004, 11:27 PM
This is the code you need to make a row of a few buttons. The buttons don&#39;t do anything (the only thing is that when you click on "quit", the title changes to "you clicked quit"). You can&#39;t even close the window with this code:



import java.awt.*;
import java.awt.event.*;

public class BankGUI extends Frame implements ActionListener{
&nbsp;protected Button quitButton, openAccountButton, depositButton;
&nbsp;protected Button getTotalAssetsButton, withdrawButton, getBalanceButton;
&nbsp;protected TextField OAAccNo, DAccNo, DAmount, &nbsp;WAccNo, WAmount;
&nbsp;protected TextField WSuccess, ABAccNo, ABAB, TBATA;
&nbsp;protected Panel bankPanel;

&nbsp;public BankGUI&#40;&#41;{

&nbsp; &nbsp;setSize&#40;800,600&#41;;
&nbsp; &nbsp;setResizable&#40;true&#41;;
&nbsp; &nbsp;setTitle&#40;&#34;My Bank&#34;&#41;;
&nbsp; &nbsp;setLocation&#40;150,250&#41;;

&nbsp; &nbsp;quitButton = new Button&#40;&#34;Quit&#34;&#41;;
&nbsp; &nbsp;quitButton.addActionListener&#40;this&#41;;
&nbsp; &nbsp;openAccountButton = new Button&#40;&#34;Open a new account&#34;&#41;;
&nbsp; &nbsp;openAccountButton.addActionListener&#40;this&#41;;
&nbsp; &nbsp;depositButton = new Button&#40;&#34;Deposit an amount&#34;&#41;;
&nbsp; &nbsp;depositButton.addActionListener&#40;this&#41;;
&nbsp; &nbsp;withdrawButton = new Button&#40;&#34;Withdraw an amount&#34;&#41;;
&nbsp; &nbsp;withdrawButton.addActionListener&#40;this&#41;;
&nbsp; &nbsp;getBalanceButton = new Button&#40;&#34;Check account balance&#34;&#41;;
&nbsp; &nbsp;getBalanceButton.addActionListener&#40;this&#41;;
&nbsp; &nbsp;getTotalAssetsButton = new Button&#40;&#34;Total balance in bank&#34;&#41;;
&nbsp; &nbsp;getTotalAssetsButton.addActionListener&#40;this&#41;;

&nbsp; &nbsp;bankPanel = new Panel&#40;&#41;;
&nbsp; &nbsp;bankPanel.add&#40;quitButton&#41;;
&nbsp; &nbsp;bankPanel.add&#40;openAccountButton&#41;;
&nbsp; &nbsp;bankPanel.add&#40;depositButton&#41;;
&nbsp; &nbsp;bankPanel.add&#40;withdrawButton&#41;;
&nbsp; &nbsp;bankPanel.add&#40;getBalanceButton&#41;;
&nbsp; &nbsp;bankPanel.add&#40;getTotalAssetsButton&#41;;


&nbsp; &nbsp;this.add&#40;&#34;South&#34;,bankPanel&#41;;

&nbsp; &nbsp;this.pack&#40;&#41;;
&nbsp;}

&nbsp;public void actionPerformed&#40;ActionEvent event&#41;{
&nbsp; &nbsp;if &#40;event.getSource&#40;&#41; == quitButton&#41;{
&nbsp; &nbsp; &nbsp; setTitle&#40;&#34;You clicked quit&#34;&#41;;
&nbsp; &nbsp; &nbsp;}
&nbsp; &nbsp;}
&nbsp;
&nbsp;public static void main&#40;String args&#91;&#93;&#41;{
&nbsp; &nbsp;
&nbsp;BankGUI bank = new BankGUI&#40;&#41;;
&nbsp; &nbsp;bank.show&#40;&#41;;
&nbsp;}
}

bigboab
03-22-2004, 11:30 PM
It is not unlike &#39;C&#39;.

4th gen
03-22-2004, 11:30 PM
Originally posted by benxuk@22 March 2004 - 22:25
thats kinda open questioned really? am i right in thinkin your using java and the project has a gui?

what you using?
JCreator as my compiler

It&#39;s a practical for my programming lab tomorrow. Basically, we have to make a GUI which drives the practical we did last week.

(I&#39;m not looking for help, btw, just wanting to let off steam :))

4th gen
03-22-2004, 11:31 PM
Originally posted by bigboab@22 March 2004 - 22:30
It is not unlike &#39;C&#39;.
Personally, I&#39;ve never used C. Up until about 7 months ago, I&#39;d never used a programming language before.

benxuk
03-22-2004, 11:33 PM
well obviously that event needs the right code to be executed, being a java n00b i dunno the exact syntax, pascal would have been formx.close; i expect the syntax in java should be quiet similair, but the question remains... what software you using?

if ya not using anything for design, try Sun One Studio 5 i got it yesterday, tis ok&#33; theres a personal edition at the sun website (http://www.sun.com) :01:

adlib: :lol: just read your last&#39;th post

adlib 2: fuck off bb code

adlib 3:
setTitle("You clicked quit"); :huh: change this bit&#33;&#33;&#33;&#33;

bigboab
03-22-2004, 11:36 PM
We had to start with Assembly language then the following in order. Basic, Pascal, Cobol, C, C++, Visual Basic plus all the database incorporated languages. :(

benxuk
03-22-2004, 11:37 PM
Originally posted by bigboab@22 March 2004 - 23:36
We had to start with Assembly language then the following in order. Basic, Pascal, Cobol, C, C++, Visual Basic plus all the database incorporated languages. :(
lololol they put you on VB after C? double-you-tea-eff

bigboab
03-22-2004, 11:39 PM
There was no VB in those early days

benxuk
03-22-2004, 11:42 PM
so why&#39;d they bother? <_<

4th gen
03-22-2004, 11:42 PM
Originally posted by benxuk@22 March 2004 - 22:33
well obviously that event needs the right code to be executed, being a java n00b i dunno the exact syntax, pascal would have been formx.close; i expect the syntax in java should be quiet similair, but the question remains... what software you using?

if ya not using anything for design, try Sun One Studio 5 i got it yesterday, tis ok&#33; theres a personal edition at the sun website (http://www.sun.com) :01:

adlib: :lol: just read your last&#39;th post

adlib 2: fuck off bb code

adlib 3:
setTitle("You clicked quit"); :huh: change this bit&#33;&#33;&#33;&#33;
Sorry, I can&#39;t make much sense of this post :(

@BB, I never knew you were so experienced in the ol&#39; programming...how hard was coding in assembly language?

benxuk
03-22-2004, 11:44 PM
did you see the bit i q&#39;d you do know that needs changing right?

bigboab
03-22-2004, 11:45 PM
It is difficult because you have to know everything that your code actually does. There was nothing to tell you what you were doing wrong. It just did not work. :lol:

Cant remember any of it now though. Have a few pascal programs i wrote before the mouse came into use.

4th gen
03-22-2004, 11:47 PM
Originally posted by benxuk@22 March 2004 - 22:44
did you see the bit i q&#39;d you do know that needs changing right?
Why does it need changed? :unsure:

benxuk
03-22-2004, 11:48 PM
do you need the form to close? :unsure:

4play
03-22-2004, 11:49 PM
java aint too bad. try doing a gui in c using the windows api and then you can complain.

@bigboab assembly to do gui stuff :helpsmile:

4th gen
03-22-2004, 11:50 PM
Originally posted by benxuk@22 March 2004 - 22:48
do you need the form to close? :unsure:
Oh, right. Nah, it doesn&#39;t need to close at the moment. I thought you were saying there was something wrong with the syntax...

4th gen
03-22-2004, 11:51 PM
Originally posted by 4play@22 March 2004 - 22:49
java aint too bad. try doing a gui in c using the windows api and then you can complain.
Got to remember I&#39;m a noob though ;)

benxuk
03-22-2004, 11:52 PM
Originally posted by 4th gen+22 March 2004 - 23:50--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (4th gen @ 22 March 2004 - 23:50)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-benxuk@22 March 2004 - 22:48
do you need the form to close? :unsure:
Oh, right. Nah, it doesn&#39;t need to close at the moment. I thought you were saying there was something wrong with the syntax... [/b][/quote]
:lol: see /me is n00b and i assumed with the paste you were having trouble :rolleyes: just hit me, i&#39;ll start working right again

4th gen
03-22-2004, 11:58 PM
Originally posted by benxuk@22 March 2004 - 22:52
:lol: see /me is n00b and i assumed with the paste you were having trouble :rolleyes: just hit me, i&#39;ll start working right again
:lol:

My fault for not being specific. It&#39;s just that I&#39;ve been working on it for a while (I started off doing absolute referencing for the buttons, I stupidly thought it might be easier (what a stupid, stupid idea that was))

h1
03-23-2004, 12:00 AM
Java is a fucking bloated language.

benxuk
03-23-2004, 12:00 AM
:rolleyes: you and your stupid eh :rolleyes:

so hows JCreator to work with then? from an frightfully n00b distance :helpsmile:

4th gen
03-23-2004, 12:07 AM
Originally posted by haxor41789@22 March 2004 - 23:00
Java is a fucking bloated language.
Yep, it&#39;s a shame that they&#39;re still teaching us it though...by the time we graduate it&#39;ll be totally obselete probably...

JCreator is a good program, it&#39;s free from the main site here (http://jcreator.com/download.htm) :)

benxuk
03-23-2004, 12:12 AM
cool, i&#39;ll enjoy this free product :D

a little off topic, anybody know how distant actionscript is from java?

h1
03-23-2004, 06:16 AM
ActionScript is Flash, and :o OT? This is the lounge&#33;