简体   繁体   English

如何用Swing制作邮票?

[英]How to make a stamp with Swing?

I'm trying to create some kind of stamp using 2 JFrame windows, one of them is transparent and the other works like a "paper".我正在尝试使用2个JFrame窗口创建某种图章,其中一个是透明的,另一个则像“纸”一样。 I only need one thing to finish it but I have a problem with the position.我只需要完成一件事,但是我对这个职位有疑问。 I don't know what to do for the "paper" window to detect where it has to draw the stamp.我不知道该如何对“纸张”窗口进行检测以检测在何处绘制邮票。

这两个窗户

The process that the user would do for drawing the stamp would be:用户绘制图章的过程将是:

  1. Write something in the Transparent frame.在透明框架中写一些东西。
  2. Overlap the transparent frame with the paper frame (positioning the preview in the desired place).将透明框与纸框重叠(将预览放置在所需的位置)。
  3. Click the accept button.单击接受按钮。
  4. The Stamp appears on the paper frame.印章出现在纸框上。

As extra information I intend to use the drawString() method of the Graphics class to draw the Stamp in the paper.作为额外的信息,我打算使用Graphics类的drawString()方法在纸上绘制Stamp

I'm trying to create some kind of stamp using 2 JFrame windows, one of them is transparent and the other works like a "paper".我正在尝试使用2个JFrame窗口创建某种图章,其中一个是透明的,另一个则像“纸”一样。 I only need one thing to finish it but I have a problem with the position.我只需要完成一件事,但是我对这个职位有疑问。 I don't know what to do for the "paper" window to detect where it has to draw the stamp.我不知道该如何对“纸张”窗口进行检测以检测在何处绘制邮票。

这两个窗户

The process that the user would do for drawing the stamp would be:用户绘制图章的过程将是:

  1. Write something in the Transparent frame.在透明框架中写一些东西。
  2. Overlap the transparent frame with the paper frame (positioning the preview in the desired place).将透明框与纸框重叠(将预览放置在所需的位置)。
  3. Click the accept button.单击接受按钮。
  4. The Stamp appears on the paper frame.印章出现在纸框上。

As extra information I intend to use the drawString() method of the Graphics class to draw the Stamp in the paper.作为额外的信息,我打算使用Graphics类的drawString()方法在纸上绘制Stamp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM