📄 quickbutton.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: QuickButton.java,v 1.1 2003/03/24 08:36:56 per_nyfelt Exp $package org.ozoneDB.adminGui.widget;import javax.swing.*;import java.awt.event.ActionListener;/** * * A JButton with some extra constructors making usage more easier */public class QuickButton extends JButton { public QuickButton(String text) { super(); this.setText(text); } public QuickButton(String text, ActionListener ae) { this(text); addActionListener(ae); } public void setText(String text) { text = extractMnemonic(text); super.setText(text); } private String extractMnemonic(String text) { //Locate the '&' character int ampersandIndex = text.indexOf("&"); //If mnemonic indicator return same localized text if (ampersandIndex == -1) { return text; } //Delete the '&' character text = text.substring(0, ampersandIndex) + text.substring(ampersandIndex + 1); //Set the mnemonic with the char after the ampersand setMnemonic(text.charAt(ampersandIndex)); //return the text without the ampersand return text; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -