How do i write a simple login page using Java programming language with the following components
-JLabel
-JTextField
-JButton

Are you looking for a tutorial? There are lots on the web.

if you are "programming in Java for the first time" and are smart, you don't.
first learn the language, the syntax and how stacktraces and the api's can be used to your advantage.
just blindly typing code you don't really understand will lead to countless hours of debugging you could've avoided.

Hi Rashee,

I would suggest that you begin to understand Java then your understanding of Graphical User Interface (GUI) will have meaning to you.

See suggested tutorial below:
http://www.tutorialspoint.com/java/

Or invest in a good textbook that carry you to GUI learning. Java How to Program 7th Edition.

Murphz: tutorialspoint and javatpoint are not good places to learn Java development.
If you do want to link to a java tutorial online, it would be better to link to the official tutorials: https://docs.oracle.com/javase/tutorial/

I agree with stultuske re tutorials
Also, books are always out of date by the time they are printed. Not to mention expensive.

Stultuske,
Good suggestion on the java tutorials online.

With regards to books, if Rashee is a beginning programmer and I suspect that he trying GUI programming might be for school purposes which should mean a recommended textbook for programming class.

In any case, that can be clarified by Rashee and therefore a clear idea what would help him best. Comments accepted and all should be helpful for Rashee.

Cheers

Murphz: yes and no. the title of this thread reads:

"programming in java for the first time" to me, this means he doesn't know how to initialize variables, how to declare them, the difference between Objects and primitives, the use of interfaces and inheritance, ...

Yes, he might be trying to start UI programming, but this is far from a recommended course. At this point, all he would be able to do, is duplicate code he doesn't understand or would not be able to write on his own.

The best way for him to start, is at the beginning, not at the 'finish'. When building a house, you start with the cellar. It's no use placing a roof if the foundations and the walls aren't there yet.

A good book is an excellent source of information. Of course you don't want to invest heavily into books for rapidly developing technology, the latest hype, etc. etc. but for stable things and general information they're far better than unedited (often flawed) blogs.

True, though keeping the official documentation (of both Oracle and the main frameworks) in sight can't be bad... In th end, they're easier to update compared to books :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.