File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes i'm into mess :( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "i Watch "i New topic
Author

i'm into mess :(

A.Al-Ansari
Greenhorn

Joined: Oct 18, 2003
Posts: 16
Helloo Dears:
i'm studing java for about 8 months we took the core java and now we are into the advanced part .. witch we are starting with swings,jdbc,networking...etc now whats the problem is!!!
the first book wasent at all good enough and our teacher knows nothing about java..lol so i finished the first semester with 84% but with even don't konwing how to programe and i still can't think or fix problems in the right manner..and the major problem is they are asking us for alot of paractical assinments and a project..!
ocfourse i'm not asking for a teacher..lol i just need some great tutorials with step by step explanation.. with covers the sing stuffs and eventhanling with arrays stuff ..and i o stream and thread these 2 are my major problems..lol
so plz dont recomend the swing tutorial..i'm reading it and its fizzy..lol but i got someting i guess it was alil bit helpfull ...
i found some ppl are begginers and they right great programes..i love java and really love to learn it cos its the nly programming language i liked its easy somehow..lol so when i can programme a huge java game..lol ohh just kidding.. so i guess i wrote alot just the last question
the (x) mark near any line in this programe means i didnt get..can any body explane!!!

i'm really sorry if bothers u... but people u will really get shoekd when somebody ask me after 1 or 2 week to build an chat a complete swing programme///
Your Best Ever...smile
[ October 18, 2003: Message edited by: Gregg Bolinger ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

smile ii,
Hi, welcome to Javaranch. We don't have too many rules around here, but we do have a Naming Policy. Please read that and change your display name to conform to the Naming Policy.
Another thing I would like to mention before getting to your problem is when displaying code, it is prefered that you use UBB Code Tags so that your code is more readable to all us geeks. I am editing your post to include those tags so you can see the difference.
Thanks.


GenRocket - Experts at Building Test Data
A.Al-Ansari
Greenhorn

Joined: Oct 18, 2003
Posts: 16
in chaned my nick to my real name but its my first time using it..i'm always smile//
so about my problem any help!?
Your Best Ever...smile
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Something that will help you a lot is to download the JavaDocs from Sun. Or if you have a permanent net connection just leave them open in a browser window while you program. The JavaDocs don't really help you with big overall issues (like "How do I program a Swing GUI"), but help a lot with questions on how to use a class or a method.

That said, here's the answers to the questions you had -



Basically, the program displays a face graphic that lets the user pick certain things to be displayed or not. For example, face is first displayed plain. User checks the 'glasses' checkbox, and face now has glasses on. User checks the 'hair' button and the face has hair. User unchecks the 'glasses' checkbox and glasses are taken off the face. This type of program could be used for games or chat applications where users get to generate their own specific 'avatar'.



setSelected( boolean ) - sets the state of the checkbox based on the parameter passed in. If you pass in 'true' the checkbox is checked. If you pass in 'false' the checkbox is not checked.



You are constructing a string based on the options chosen with the checkboxes. This string really represents a specific GIF file that you want to load. The string for the GIF file is passed into an ImageIcon. ImageIcon is a class that encapsulates painting an image that can be used on almost any component, so you don't have to make a custom component every time just to paint an image on it. The ImageIcon is passed into the constructor of a JLabel, which means that this JLabel will have the image that the ImageIcon holds painted on it.

That's all the questions I see in your code... hopefully I've helped you out on some of this stuff... remember that the JavaDocs will let you look up help even faster on most things!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
sandhiya sindhi
Ranch Hand

Joined: Sep 25, 2003
Posts: 50
Helloo Mr Smile!
After reading ur such a long story of study..and subject of ur book.. i'm sure that ur an APTACHTIES(means aptech student).... r u

if yes than u must study hard and i'm 200% sure that u didnt care about programing from start so that is why now ur too much confused..
A.Al-Ansari
Greenhorn

Joined: Oct 18, 2003
Posts: 16
thanks alot it really helped me..but i got another lil question.. it means that there are 4 folder with 16 pic and i have to give then the names with the 4 chars only!!! and he will choose of them
Ohh my god ..lol u r really smart..
so i guess its the same around the world..lol so u got the same problem to..do u got any advices ..and witch country ur from
Your Best Ever...smile
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I'm not really that smart I just read through the code. All the calls to pictureLabel create an icon using an image. The code assumes the image is going to be in the "images/geek/" subdirectory of the current directory, and that all the files are going to be named "geek-xxxx.gif". All the variations are given in the starting comment of the program. You build the replacement for the "xxxx" part by seeing which checkboxes the user has checked.

One piece of advice is to be sure that you get your instructor to explain what he wants you to do in your assignment until you completely understand what he wants. You can be the best programmer in the world, and you can program the best application ever, but if it doesn't do what the professor assigned you to do, it's not going to get high marks. (This is true outside of school, too... just replace professor with "user" or "boss" )

Other than that, the only advice I have is stay in milk, eat your school, drink your drugs, and just say no to vegetables. Or something like that...





Oh, and I'm from the US.
sandhiya sindhi
Ranch Hand

Joined: Sep 25, 2003
Posts: 50
Helooo again...
hmm well Mr smile mery asey hal nahin hey jesey k ap k hain or hamin bohot achha eprhaya ja rahah ey aptech main.. we r sure
wasey main bh second semster main hon.
or asey kesey bata don k kis country main hon main haan..wasey lagtah ey aap khi sey hoo. r u
byzzz
think on my sixth sence
A.Al-Ansari
Greenhorn

Joined: Oct 18, 2003
Posts: 16


Other than that, the only advice I have is stay in milk, eat your school, drink your drugs, and just say no to vegetables. Or something like that...





Oh, and I'm from the US.[/QB]

so my school sucks..lol we dont professers we got non-teachers..lol but i'm realy trying to undeertand how to programme it was my joy as was kid to be a programer but i cant get the way of thniking and how cna i thnik of a further class..lol for ex: im doing a programme in thr main class i cant think how and why to do th other classe..no telescope.lol
but i bough a book called introduction to java with jbulider ..and its not bad untill the 2nd chapter starting to get sometihng...lol
thanks alot for ur help.. and try give me adivices every day untill i became like u
sandhiya Laghari : lol i dont know indian..lol i'm living in the arabian gulf and i'm from bahrain but living in qatar..so plzz translate..lol
by the way i got an aword wining site..lol here it is check it: www.mjheaven.tk
Your Best Ever...smile
sandhiya sindhi
Ranch Hand

Joined: Sep 25, 2003
Posts: 50
hi again...
well if u didnt understand so it is very good..

u r asking about how to make another class for work..
for such u jsut make a class like as:
public class NameofUrClass()
{
.............
}
now u must think that how can u use it so,
make a method in it because u have to do each and verything in methods in second class. or if u have define its constructor than u use it by making its object.and than u have opertunaty to access its methods too.

AM I RIGHT SIR Nathan Pruett
i'm also a begniner in such field sir..
Thank u
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

sandhiya, you are pretty much right about using other classes. Just create a class, create the methods you need, create a constructor to set up the class and get a reference to it. That's pretty much all you need to know about how to create another class. The difficult part to answer is when and why you need another class. Classes are used so that you can encapsulate functionality in your code. When you are working on a class you can focus on only what the class does and how it does it. Later, when you are using the class from another class, you really only have to think about what the class lets you do, you don't have to think about how it does it. Classes serve pretty much the same purpose as methods. They break up your program into manageable chunks so that you can focus on each. They have some advantages over pure functions, though... you can switch classes out easier than you can switch functions. Classes can also inherit functionality... some classes may do the same things as others, but do one specific thing differently.

This is all really about Object Oriented (OO) Design and Programming... which is something I've found is one of those 'AHA!' type of things... you can be taught about OO so much and write OO programs basically by copying the structure of programs your instructor or a book told you were OO. After working with it a while (it can be quite a while!) it will suddenly click. You'll be thinking something like... "I keep having to change this one method... it has a big if/else block that does different things based on the type of object I pass to it. CLICK! AHA! Wait... If I make each of these objects a subclass of a superclass, I can just make each have a different implementation of a method with the same name to call here!" Encapsulation and inheritance, two of the basic properties of OO, just made sense to you. You may have read this, or been told this, many, many times, but you really don't 'get it' until you run into a problem and suddenly your thinking process works it out this way. It might take a while... but the best way to learn this is to just code as much as you can. Write programs out of books to get the syntax down and learn about classes that the Java APIs provide you. Have the JavaDocs handy to refer to about how to use specific classes. Come up with projects on your own so that you will think through some issues and learn how to solve them.

It also helps after you have learned one programming language to learn another. Learning another programming language will help you to separate programming concepts (i.e. what you want to do) from syntax(i.e. how you say it in a particular programming language). Different languages do things a little differently, and it will help give you ideas about how to do new things in your own programs. Also look into learning about computer architecture, operating systems, networks, etc. Each of these topics will help you learn more about how to get the computer to do what you want it to do - the basic premise of programming. This isn't something you're going to do overnight or even in a year... it's long term... just do a little bit at a time and keep adding to your knowledge.

Anyway, this topic is starting to get out of the focus of this forum... (GUI programming in Java) and getting into a more general discussion about programming in general, learning, etc. For general Java questions you can also post in the Java In General (Beginner) forum here on JavaRanch... there's also an Object Oriented Design forum to ask more general design questions. It's also a good idea to just read posts there to get some information on things other people are facing problems with and reading suggestions and solutions to those problems that other people post... sooner or later you'll probably face the same problem and the information will come in handy!
A.Al-Ansari
Greenhorn

Joined: Oct 18, 2003
Posts: 16
Ohh my god that was one of the greatest explanation i ever had..lol
thanks alot and its really was in handy ..and sorry i my question went out of bound ..but at last i got sometihng .. thanks alot
Your Best Ever...smile
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i'm into mess :(
 
Similar Threads
Randomize checked checkboxes?
How can I change the button's icon when it's disenabled?
Missing Symbol Errors
What is wrong in this code!
Swing classes Vs JDK 1.3! APIs, Methods