简体   繁体   English

如何自定义Eclipse About对话框的about文本?

[英]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.iniabout.propertiesabout.html You can probably use about.html for your image links. 您可能可以使用about.html作为图像链接。

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

相关问题 如何在Eclipse 3.8.1 RCP应用程序的“帮助”菜单下的“关于”条目中自定义文本和按钮 - How to customize text and buttons for the About entry under the Help Menu in a Eclipse 3.8.1 RCP application 如何停止有关目标文件夹内容的Eclipse警告? - How can I stop Eclipse warning about target folder's contents? 如何在AST eclipse中检索有关类的继承信息? - How can I retrieve inheritance information about a Class in AST eclipse? 如何自定义Eclipse的getter和setter生成? - How can I customize Eclipse's getter and setter generation? 如何在GMF中自定义对话框? - How can i customize a dialog box in GMF? 如何让Eclipse(或javac)警告过度包含的throws子句 - How can I make Eclipse (or javac) warn about over-inclusive throws clauses 如何使用Eclipse将图像添加到Java项目中? - How do I go about adding an image into a java project with eclipse? 如何解决有关setOnClickListener的问题 - How can I solve the problem about setOnClickListener 什么是 JaMP,我如何了解它? - What is JaMP and how can I learn about it? 我如何在Android的“偏好设置”中添加一些文本(即某种“关于”信息) - How can i add some text (i.e. kind of “about” info) in Preferences in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM