Hey, I have an issue with my JButton, and JTextField components; they’re both repeating themself in a strange pattern, also overlapping, so it look’s very crazy in the applet.
Screen: http://oi51.tinypic.com/343svv8.jpg
import javax.swing.*;
import java.applet.*;
import java.math.*;
import java.util.*;
import java.awt.*;
public class Calculator extends Applet
{
public int a;
public String b = "Hello";
public void paint(Graphics g)
{
// Our methods for the design.
setBackground(Color.WHITE);
// Components.
JButton roll = new JButton();
roll.setSize(85,24);
add(roll);
JTextField wf = new JTextField();
wf.setSize(645,24);
wf.setPreferredSize(new Dimension(645,24));
add(wf);
// Outputs.
g.drawString("text.");
}
}
I want to align each component based on coordinates in the applet, and not only center, south, west, etc. I just got into 2D graphics designs and components, etc.
Regards