twisty
Posts: 22
Nickname: twisty
Registered: Nov, 2002
|
|
Re: precise positioning of ocmponents
|
Posted: Nov 20, 2002 3:42 PM
|
|
Heres a small example for you:
// NullApplet.java
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
public class NullApplet extends JApplet {
JPanel mainPanel = new JPanel();
JTextField textField = new JTextField();
JButton button = new JButton();
public void init() {
this.setSize(new Dimension(400,300));
mainPanel.setLayout(null);
textField.setBounds(new Rectangle(18, 98, 237, 36));
button.setBounds(new Rectangle(258, 98, 58, 36));
button.setText("Clicky");
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
mainPanel.add(textField, null);
mainPanel.add(button, null);
}
}
The html is:
<HTML> <HEAD> </HEAD> <BODY BGCOLOR="000000"> <CENTER> <APPLET code = "NullApplet.class" width = "500" height = "300" > </APPLET> </CENTER> </BODY>
<script language="JavaScript"> <!--
window.open = SymRealWinOpen;
//--> </script>
</HTML>
|
|