package com.main;
import javax.swing.*;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import java.awt.*;
import java.awt.event.*;
public class MassageDialogDeom {
public void init(){
Frame jFrame=new Frame("test Menu");
Box horizontalBox = Box.createHorizontalBox();
horizontalBox.add(new Button("no1"));
horizontalBox.add(Box.createHorizontalGlue());
horizontalBox.add(new Button("no2"));
horizontalBox.add(Box.createHorizontalStrut(30));
horizontalBox.add(new Button("no3"));
Box verticalBox = Box.createVerticalBox();
verticalBox.add(new Button("no1"));
verticalBox.add(Box.createVerticalGlue());
verticalBox.add(new Button("no2"));
verticalBox.add(Box.createVerticalStrut(30));
verticalBox.add(new Button("no3"));
jFrame.add(horizontalBox,BorderLayout.NORTH);
jFrame.add(verticalBox);
jFrame.pack();
jFrame.setVisible(true);
}
public static void main(String[] args) {
new MassageDialogDeom().init();
}
}
image.png
网友评论