0

I need help position a bunch of things. Mostly the text bar.

Here's my code:

package swingHW2;
import java.util.Scanner;
import javax.swing.*;
import java.awt.*;


public class swingHW2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		// The Layout
		FlowLayout lout = new FlowLayout();
		
		// The Frame AHAHAHAHA!
		JFrame frame = new JFrame();
		
		// Frame Options
		frame.setTitle("Flash Cards Creator v0.5");
		frame.setSize(500,500);
		frame.setVisible(true);
		frame.setLayout(lout);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		
		// Labels
		JLabel label1 = new JLabel("Hi");
		
		
		
		// Text Field
		JTextField tf1 = new JTextField(10);
		tf1.setText("Enter Deck Name");
		
		
		// Adding GUI Components
		frame.add(tf1);
		frame.add(label1);
		
	
	}

}

Please Help!

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by penguino138
0

Thanks for the link. Now i need help with an error. It says: Syntax error on token(s), misplaced construct(s)
Syntax error token "void", @ expected

Any help?

0

Do you think people here can read your mind or see over your shoulder? Post your code and the stack trace.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.