另外,在 JAVA APPLET 里有没有取一个象素的函数(getPixel(x,y))?

解决方案 »

  1.   

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;class TextRotatePanel extends JPanel 
    {
    public void paintComponent(Graphics g)
    {
    super.paintComponent(g);
    Graphics2D g2=(Graphics2D)g;
    g2.drawString("1.文本未旋转",10,100);
    g2.rotate(3.1415926/2,100,100);
    g2.drawString("2.文本顺时针旋转90度^_^",100,100);
    g2.drawString("2.1 文本顺时针旋转90度^_^",110,120);
    g2.drawString("2.2 文本顺时针旋转90度^_^",120,140);
    g2.rotate(-(3.1415926/2),100,100);
    g2.drawString("3.文本恢复水平",150,100);
    g2.rotate(3.1415926/2,250,100);
    g2.drawString("4.文本顺时针旋转90度^_^",250,100);

    }
    }class TextRotateFrame extends JFrame
    {
    public TextRotateFrame()
    {
    setTitle("文本旋转");
    setSize(400,300);
    addWindowListener(new WindowAdapter()
    {
    public void windowClosing(WindowEvent e)
    {
    System.exit(0);
    }
    });

    JTabbedPane tabPane=new JTabbedPane();
    tabPane.addTab("1",new JPanel());
    //tabPane.add(new TextRotatePanel(),"test"); //也可以
    tabPane.addTab("test",new TextRotatePanel());

    Container contentPane=getContentPane();
    contentPane.add(tabPane);
    }
    }public class TextRotate
    {
    public static void main(String[] args)
    {
    JFrame objFrame=new TextRotateFrame();
    objFrame.show();
    }
    }
      

  2.   

    to magus_yang(⊙杨⊙):
    我用的是 VJ++6.0,没有 javax 包。能给我一个吗?
      

  3.   

    down个jdk1.3.1装一下不就有了?