[英]How can I customize Eclipse About dialog's about text?
I am trying to reuse Eclipse's About dialog in my application. 我正在尝试在应用程序中重用Eclipse的About对话框。 What I need to do is to add image, hyperlinks, and image links in aboutText, but it seems only hyperlinks are possible in aboutText?
我需要做的是在aboutText中添加图像,超链接和图像链接,但是看来aboutText中仅可能有超链接? Is there a way to add images/image links without providing my own About dialog implementation?
有没有添加图像/图像链接而不提供我自己的“关于”对话框实现的方法?
thanks, 谢谢,
Use JDialog
. 使用
JDialog
。 You can add JPanel
object(s) inside it. 您可以在其中添加
JPanel
对象。 You are able to put images, hyperlinks, text, labels into JPanel. 您可以将图像,超链接,文本,标签放入JPanel。 So it should be trivial.
因此,它应该是微不足道的。
Take a look at this code snippet and test it. 查看此代码段并进行测试。 You can refer to external image URLs using HTML tags as well.
您也可以使用HTML标记引用外部图像URL。 Check out this line:
查看以下行:
creditsLabel.setText( "<HTML><IMG SRC=\"http://siesbilkent.appspot.com/images/admin.png\"></IMG></HTML>" );
Sample code: 样例代码:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class MyDialog extends JDialog
{
private JLabel creditsLabel;
public MyDialog ( JFrame frame )
{
super( frame, "Credits", true );
JPanel panel = new JPanel( new FlowLayout() );
panel.setBackground( new Color( 255, 0, 128 ) );
creditsLabel = new JLabel();
creditsLabel.setText( "<HTML><IMG SRC=\"http://siesbilkent.appspot.com/images/admin.png\"></IMG></HTML>" );
panel.add( creditsLabel );
this.getContentPane().add( panel );
this.setPreferredSize( new Dimension( 240, 160 ) );
this.pack();
this.setLocationRelativeTo( null );
this.setResizable( false );
}
public static void main ( String [] args )
{
MyDialog dialog = new MyDialog( new JFrame() );
dialog.setModal( true );
dialog.setVisible( true );
}
}
If you're looking to customize eclipse based application/product then check out this manual . 如果您要自定义基于Eclipse的应用程序/产品,请查阅本手册 。 There are three files that control the branding:
about.ini
, about.properties
and about.html
. 有三个控制品牌的文件:
about.ini
, about.properties
和about.html
。 You can probably use about.html
for your image links. 您可能可以使用
about.html
作为图像链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.