2

Till now, I was using VB for developing applications. Now I have to use Java for developing the front-end. I am quite confused with the Components. Need help.. A book reference or site reference would also do the job.

Basically, I will be using MenuBar, ToolBar, a Frame with JEditorPane. Now if I want to use a small window which will be a child form, to write some notes, of the master frame, which Component should I use?

John
  • 2,820
  • 3
  • 30
  • 50
  • 3
    Java has a nice tutorial for this: http://download.oracle.com/javase/tutorial/uiswing/ http://download.oracle.com/javase/tutorial/ui/features/compWin.html – NCode Nov 03 '11 at 12:22

3 Answers3

3

You can use a JInternalFrame for this. Follow this link for a demo

Components are quite easy to understand. A detailed tutorial is given here. But to tell you the gist Components are nothing but containers. For example JPanel is a component which can hold another component for example a JButton. Since JButton is again a container, you can add one more component, a JPanel to it.

The order and placement of the components that you add are determined by layouts. You have different layouts viz Borederlayout, BoxLayout, Flowlayout, GridLayout, GridBaglayout each having its own pros and cons and behaviors on how it reacts when window is resized.

For an IDE, I would recommend using Netbeans as you can drag and drop components as well as take a look at the generated Java source code to get a better understanding.

bragboy
  • 34,892
  • 30
  • 114
  • 171
3

I guess you're looking for a JDialog or a JPanel. Follow the Swing tutorial. It has detailed guidelines for every component, and has a visual index of all the components.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
3

You want to the develop desktop applications using java right?

You need:

-Installed JDK(Java development Kit)

-You will need an IDE. My favourite is Eclipse. There are many out there, but maybe the most intuitive for beginners in java might be Netbeans.

-When creating applications that use the components you mentioned, you will be using the libraries in the pagcage javax.swing(See the documentation in the link)

-And finally, just one more suggestion(Optional), is to get also a most powerfull IDE, just for graphics, so you can speed up your programming.I suppose you would like to speed up your development. In that case i highly recommend you this tool: JFormDesigner Watch the videos and in matter of a couple of hours you will be developing interfaces fast as light :)

I hope this is useful

javing
  • 12,307
  • 35
  • 138
  • 211