vue移动端怎么使用默认浏览器打开第三方html链接
时间: 2023-12-21 09:03:14 浏览: 63
以下是用Java语言实现的点格棋棋盘:
```java
import javax.swing.*;
import java.awt.*;
public class DotGridChessBoard extends JPanel {
private int rows, cols, dotSize;
private Color bgColor, dotColor;
public DotGridChessBoard(int rows, int cols, int dotSize, Color bgColor, Color dotColor) {
this.rows = rows;
this.cols = cols;
this.dotSize = dotSize;
this.bgColor = bgColor;
this.dotColor = dotColor;
setPreferredSize(new Dimension(cols * dotSize, rows * dotSize));
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
setBackground(bgColor);
g.setColor(dotColor);
for (int row = 0; row < rows; row++) {
for (int col = 0; col < cols; col++) {
int x = col * dotSize + dotSize / 2;
int y = row * dotSize + dotSize / 2;
g.fillOval(x, y, dotSize, dotSize);
}
}
}
public static void main(String[] args) {
DotGridChessBoard board = new DotGridChessBoard(8, 8, 20, Color.WHITE, Color.BLACK);
JFrame frame = new JFrame("Dot Grid Chess Board");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(board);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
```
运行结果:
![Dot Grid Chess Board](https://i.imgur.com/19JhzZr.png)
阅读全文