?? sketchview.java
字號:
import javax.swing.*;
import java.util.*; // For Observer
import java.awt.*; // For Graphics
class SketchView extends JComponent
implements Observer
{
public void paint(Graphics g)
{
// Temporary code
Graphics2D g2D = (Graphics2D)g; // Get a Java 2D device context
g2D.setPaint(Color.red); // Draw in red
g2D.draw3DRect(50, 50, 150, 100, true); // Draw a raised 3D rectangle
g2D.drawString("A nice 3D rectangle", 60, 100); // Draw some text
}
public SketchView(Sketcher theApp)
{
this.theApp = theApp;
}
// Method called by Observable object when it changes
public void update(Observable o, Object rectangle)
{
// Code to respond to changes in the model...
}
private Sketcher theApp; // The application object
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -