Hi,
So I'm new to programming in java. I want to build a program with an GUI for the user to interact with. It would be very basic, show images and labels and buttons. I'm just having a hard time finding any information on how to do this. I know there are various different layout managers for java applets that can be used to do this but none of them are really working.
Does anyone know of any easy way to do this?
Thank you
5 replies to this topic
#1
Posted 21 December 2010 - 05:17 PM
|
|
|
#2
Posted 21 December 2010 - 08:59 PM
You can use java swing to do this.
Perhaps this link is helpful to you:
Java Swing Tutorial | Java Beginner
Good luck.
Regards.
Perhaps this link is helpful to you:
Java Swing Tutorial | Java Beginner
Good luck.
Regards.
#3
Posted 22 December 2010 - 12:55 AM
Care to draw us a mockup of the UI you want?:c-smile:
#4
Posted 23 December 2010 - 05:15 PM
What is your program going to do?
Here is one very very generic example using border layout
MAIN METHOD
Hope this gets you started.
Here is one very very generic example using border layout
// add the imports to run below code
public class SomeClass extends JPanel{
private JButton jb1, jb2, jb3;// assuming you want three j buttons
private JPanel jp1, jp2, jp3;// " " "" three j Panels to go on your panels
private JTextField jtf1, jtf2;// same thought
private JLabel jl;
public SomeClass(){
super(new BorderLayout());
// add to the borderlayout
}
public JPanel northPanel(){
// add buttons, image, or text field
}
public JPanel southPanel(){
// add more stuff
}
// create methods for other panels
// you can add action events for the panels here
}
MAIN METHOD
public class ShowWork{
public static void main(String [] arrrrr){
JFrame frame = new JFrame("Enter name of app");
SomeClass sc = new SomeClass();
frame.add(sc);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
Hope this gets you started.
Edited by mr mike, 23 December 2010 - 05:35 PM.
add more
#5
Posted 24 December 2010 - 01:46 PM
Thanks for all the replies. I ended up using netbeans design feature to build Java desktop applications, swing GUI forms, making Jframe Forms. Its exactly what i was looking for. Sorry maybe that was redundant but I'm new and i wanted to give all the information. What I'm trying to ask is if anyone knows of any good tutorials or books or anything that can help me start designing basic programs with the 'design' feature in netbeans?
Thanks for everyones help again I really appreciate it.
Thanks for everyones help again I really appreciate it.
#6
Posted 28 December 2010 - 02:58 AM
You may want to consider using JavaFX as well. You can create much nicer UI with JavaFX.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









