是.看看Graphics2D.rotate().对于JLabel,我认为你可以覆盖paintComponent()方法来调用rotate(x),然后调用现有的paintComponent(),然后调用rotate(-x).例如
protected void paintComponent(Graphics g) {
Graphics2D g2 = ( Graphics2D )g;
g2.rotate(theta);
super.paintComponent(g2);
g2.rotate(-theta);
}
Run Code Online (Sandbox Code Playgroud)
我没试过这个.您可能需要添加偏移量,请参阅Graphics2D.rotate(double theta,double x,double y)
| 归档时间: |
|
| 查看次数: |
4965 次 |
| 最近记录: |