1.����Դ��
����Դ��
import java.awt.*;/
*** @author Hardneedl
*/
interface Brush {
void doPaint(Graphics g);
}
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
/
*** @author Hardneedl
*/
final class StringPaintDemo extends JFrame {
public String getTitle() { return "String Paint";}
static private final Dimension size = new Dimension(,画板画板wap小偷源码 );
public Dimension getPreferredSize() { return size;}
public Dimension getMaximumSize() { return size;}
public Dimension getMinimumSize() { return size;}
public Dimension getSize() { return size;}
private String s;
private Brush stringBrush = new Brush() {
public void doPaint(Graphics g) {
Graphics gg = g.create();
gg.setColor(Color.RED);
gg.drawString(s == null ? "null" : s , , );
gg.dispose();
}
};
private JTextField txtField;
private JComponent canvas = new JComponent(){
protected void paintComponent(Graphics g) {
super.paintComponent(g);
stringBrush.doPaint(g);
}
};
private StringPaintDemo() throws HeadlessException {
init();
attachListeners();
doLay();
}
private void init() {
txtField = new JTextField();
}
private void attachListeners() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
txtField.getDocument().addDocumentListener(new DocumentListener(){
private void update(){
s = txtField.getText();
canvas.paintImmediately(canvas.getBounds());
}
public void changedUpdate(DocumentEvent e) { update();}
public void insertUpdate(DocumentEvent e) { update();}
public void removeUpdate(DocumentEvent e) { update();}
});
}
private void doLay() {
Container container = getContentPane();
container.add(txtField,BorderLayout.NORTH);
container.add(canvas, BorderLayout.CENTER);
pack();
setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new StringPaintDemo();
}
});
}
}
2025-01-19 12:492459人浏览
2025-01-19 12:31836人浏览
2025-01-19 12:242342人浏览
2025-01-19 11:512844人浏览
2025-01-19 10:501198人浏览
2025-01-19 10:19722人浏览
當地時間10月26日,以色列軍方發言人哈加里發表視頻聲明稱,「為應對伊朗數月來對以色列的持續襲擊,以軍目前正在對伊朗的軍事目標進行精確打擊,以色列的防禦和進攻能力得到充分動員。」哈加里稱,「自去年10
1.手把手教你提交Jar包到Maven公共仓库2.Maven中央仓库中的 /org/apache/maven/plugins/ 是什么?3.org.csource.fastdfså¨åªä¸ªja
1.jps是什么货币jps是什么货币 JPS是一种电子支付和货币结算系统,并非一种独立的货币。 JPS全称为“日本支付系统”,它是日本国内的一种电子支付系统,主要用于处理各种金融交易。该系统通