import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class myFrame extends JFrame
{
public myFrame()
{
setSize(400,400);
setTitle("vivan is beautiful");
getContentPane().add(new JLabel("<html>垂<br>直<br>显<br>示</html>"),BorderLayout.NORTH);
//setUndecorated(true);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{System.exit(0);}
});
}
public static void main(String[] args)
{
myFrame myframe=new myFrame();
myframe.show();
}
}
import java.awt.*;
import java.awt.event.*;
class myFrame extends JFrame
{
public myFrame()
{
setSize(400,400);
setTitle("vivan is beautiful");
getContentPane().add(new JLabel("<html>垂<br>直<br>显<br>示</html>"),BorderLayout.NORTH);
//setUndecorated(true);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{System.exit(0);}
});
}
public static void main(String[] args)
{
myFrame myframe=new myFrame();
myframe.show();
}
}
public static ImageIcon createVerticalTextIcon(String name, int widthp,int heightp)
{
int width = widthp;
int height = heightp;
BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = (Graphics2D)bi.getGraphics();
Color c= new Color(0, 0, 0, 0);
g2.setColor(c);
g2.fill(new Rectangle(bi.getWidth(), bi.getHeight()));
g2.setColor(Color.black);
//g2.rotate((-0.5)*Math.PI, width/2, height/2);
g2.rotate((0.5)*Math.PI, width/2, height/2);
Font serifFont = new Font("Serif", Font.PLAIN, 18);
AttributedString as = new AttributedString(name);
as.addAttribute(TextAttribute.FONT, serifFont);
as.addAttribute(TextAttribute.FOREGROUND, Color.red);
g2.drawString(as.getIterator(), width/2,height/2);
// g2.drawString(as.getIterator(), -width/2,-height/4);
Image image = (Image)bi;
ImageIcon icon = new ImageIcon(image);
return icon;
}