的Java Swing / AWT组件绘制棋盘 [英] Java swing/awt component to draw chessboard
问题描述
我没有摆动/ AWT多的工作经验。
I don't have much experienc with swing/awt.
我的问题是:
我需要绘制像棋盘(N×N个)。
总的来说,我需要获得访问每一个细胞进行更改(当程序运行时如我按一下按钮,一些与细胞发生在该板)。
这将是马丽娟如果组件
让我在小区设置了图片
。
My problem is:
I need to draw something like chessboard (NxN).
In general I need to get access to every cell to make changes (when program is running e.g. I click button and something is happen with cells on that board).
It will be greate if a Component
let me to set in cell a Image
.
我尝试使用网格布局
,但我什么也没得到什么满足我。
I try to use GridLayout
but I get nothing what satisfy me.
你有任何想法如何简单地解决这一问题?
Do you have any idea how to simply resolve that problem?
推荐答案
有其实是一个相当的例如合理的在线上roseindia。
There is actually quite a reasonable example online on roseindia.
这篇关于的Java Swing / AWT组件绘制棋盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!