Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @(#)bad.java
- * @program application desktop
- * @author : badwolves1986
- * @thanks to R3c0gnized your my inspirate ,my friend,and you my love
- * @version 1.00 2011/9/11
- */
- import java.awt.*;
- import java.awt.event.*;
- import java.applet.Applet;
- import javax.swing.*;
- public class bad extends Applet {
- JPanel panel_1;
- JTextArea bd86;
- JScrollPanel sp_bd86;
- public void init() {
- badLayout customLayout = new badLayout();
- setFont(new Font("Helvetica", Font.PLAIN, 12));
- setLayout(customLayout);
- panel_1 = new JPanel();
- add(panel_1);
- bd86 = new JTextArea("0x001986");
- sp_bd86 = new JScrollPanel(bd86);
- add(sp_bd86);
- setSize(getPreferredSize());
- }
- public static void main(String args[]) {
- wae applet = new wae();
- Frame window = new Frame("wae");
- window.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- System.exit(0);
- }
- });
- applet.init();
- window.add("Center", applet);
- window.pack();
- window.setVisible(true);
- }
- }
- class waeLayout implements LayoutManager {
- public badLayout() {
- }
- public void addLayoutComponent(String name, Component comp) {
- }
- public void removeLayoutComponent(Component comp) {
- }
- public Dimension preferredLayoutSize(Container parent) {
- Dimension dim = new Dimension(0, 0);
- Insets insets = parent.getInsets();
- dim.width = 320 + insets.left + insets.right;
- dim.height = 240 + insets.top + insets.bottom;
- return dim;
- }
- public Dimension minimumLayoutSize(Container parent) {
- Dimension dim = new Dimension(0, 0);
- return dim;
- }
- public void layoutContainer(Container parent) {
- Insets insets = parent.getInsets();
- Component c;
- c = parent.getComponent(0);
- if (c.isVisible()) {c.setBounds(insets.left+64,insets.top+40,216,160);}
- c = parent.getComponent(1);
- if (c.isVisible()) {c.setBounds(insets.left+80,insets.top+56,184,128);}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement