易语言实现图层效果

2024-11-29 10:24:24
推荐回答(1个)
回答1:

import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;
import javax.swing.border.*;
public class jframe {
/祥基滚运**
* @param args
*/
public void CreateJFrame(String title) {
JFrame jf = new JFrame(title);
Container container = jf.getContentPane();
JLabel jl = new JLabel("谨备谨");
jl.setHorizontalAlignment(SwingConstants.CENTER);
container.add(jl);
container.setBackground(Color.white);
jf.setVisible(true);
jf.setSize(200, 150);
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
};