You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
package de.memtext.dlg; |
|
|
|
import java.awt.Dimension; |
|
import java.awt.Frame; |
|
import java.awt.HeadlessException; |
|
import java.io.IOException; |
|
|
|
import javax.swing.JLabel; |
|
|
|
import de.memtext.util.BrowserLauncher; |
|
import de.memtext.util.WindowUtils; |
|
import de.memtext.widgets.VerticalBox; |
|
|
|
public class AboutDialog extends OkDlg { |
|
private JLabel infoLbl, homepageLabel; |
|
|
|
public AboutDialog(Frame parent, String title, String infoText, String homePageLink, final String homepageUrl) throws HeadlessException { |
|
super(parent, title); |
|
infoLbl = new JLabel(infoText); |
|
homepageLabel = new JLabel("<html><u>" + homePageLink); |
|
homepageLabel.addMouseListener(new java.awt.event.MouseAdapter() { |
|
|
|
@Override |
|
public void mouseClicked(java.awt.event.MouseEvent evt) { |
|
|
|
try { |
|
BrowserLauncher.openURL(homepageUrl); |
|
} catch (IOException e) { |
|
e.printStackTrace(); |
|
} |
|
} |
|
}); |
|
|
|
VerticalBox vbox = new VerticalBox(); |
|
vbox.addWithCenterAlignment(infoLbl); |
|
vbox.addWithCenterAlignment(homepageLabel); |
|
setCenter(vbox); |
|
pack(); |
|
Dimension size = this.getSize(); |
|
setSize(size.width + 30, size.height + 30); |
|
WindowUtils.center(this); |
|
} |
|
|
|
} |
|
|
|
//Created on 18.06.2004 at 12:20:35
|