我正在尝试制作一个名为Concentration的存储卡匹配游戏.到目前为止,我有3个班级.内存扩展JFrame实现了ActionListener
Board扩展了JPanel实现的ActionListener
Cell扩展了JButton
到目前为止,我已经实现了一个弹出窗口.使用列表添加成对的单元格类型.在我的董事会中随机分配所有单元格.显示所有单元格的背面(img)(有24个单元格,4行6列).现在当我点击我的卡片时,我得到一张白色图片.目前作为一个短期目标,我想要实现的是,当我点击一个按钮时,相应的图像显示在按钮上.
我在类Board中以这种方式实现了ActionPerformed.
public void actionPerformed(ActionEvent e){
if(e.getSource() instanceof Cell){
Cell temp = (Cell)e.getSource();
temp.setSelected(true);
if (temp.selected()){
int row = temp.getRow();
int column = temp.getColumn();
board[row][column].setIcon2();
}
}}
Run Code Online (Sandbox Code Playgroud)
我的set selected方法仅用于将Cell类中的布尔变量的值更改为true.这是我在类Cell中的setIcon2方法.
public void setIcon2(){
ImageIcon x = new ImageIcon();
x = getImageIcon();
setIcon(x);
}
Run Code Online (Sandbox Code Playgroud)
这是Cell类中的getImageIcon方法.
private ImageIcon getImageIcon() {
int temp=0;
int id;
if (localSelected) {
id = getType();
String tempId = Integer.toString(id);
icons[temp] = new ImageIcon("img-" + tempId + ".jpg");
temp++;
return icons[temp];
} else {
id = …Run Code Online (Sandbox Code Playgroud) 我在托盘栏上找到托盘图标(在px中)时遇到问题.
我可以找到托盘而不是图标.这是我正在使用的代码:
unit uTrayIconPosition;
interface
uses
Types;
function GetTrayIconPosition(const AWnd: THandle; const AButtonID: Integer; var APosition: TRect): Boolean;
implementation
uses
Windows, CommCtrl, Classes, SysUtils;
function EnumWindowsFunc(AHandle: THandle; AList: TStringList): Boolean; stdcall;
var
P: array [0..256] of Char;
S: string;
begin
if GetClassName(AHandle, P, SizeOf(P) - 1) <> 0 then
begin
S := P;
if S = AList[0] then
begin
AList[0] := IntToStr(AHandle);
Result := False;
end
else
Result := True;
end
else
Result := True;
end;
function FindClass(AName: string; AHandle: …Run Code Online (Sandbox Code Playgroud) 我一直试图复制这个边界几个小时没有成功:

有关如何做到这一点的任何想法?
有没有办法改变主要面的手风琴面板中的图标?
我想将右箭头和向下箭头更改为加号([+])和减号([ - ])符号.
谁能解释怎么做?
谢谢.
我正在开发一些NetBeans平台应用程序,目前我仍然坚持使用Visual Library中的一些细节.好的,这是问题.我有我的应用程序的Visual Editor,托盘,场景和一切都很好,只是当我从托盘拖动图标时出现问题.在拖动事件期间不显示它们,我想创建该效果,有人可以帮忙吗?
我从官方Android开发者网站上下载了icon pack.我想放入我的菜单标准主页图标,但我无法找到它哦
我在哪里可以找到.png中的这个图标?http://i.stack.imgur.com/Pa1TS.png
我是一名C#程序员,我对VB的了解几乎为零.具有讽刺意味的是,在我的工作中,我正在开发一个基于传统VB6版本的项目.我发现很多东西对我来说都不熟悉,就像下面的两个表格图标一样.
和 
第二个图标看起来有点模糊,就像Windows资源管理器中的隐藏文件或文件夹一样.谁能说出这两者之间的区别?他们对有关表格有什么暗示?
有没有办法获取另一个Android应用程序的图标的资源ID?(例如com.android.systemui.R.drawable.ic_xxx)
我试过context.getApplicationInfo().icon但它返回了一个长整数.这可能吗?
谢谢
我有一个以下列格式保存的图标:
//icon.h
extern const unsigned char icon[];
//icon.cpp
const unsigned char icon[]={0x17,0x3f,0x0c,....,0x10,0x06}
Run Code Online (Sandbox Code Playgroud)
现在我想将此图标添加到状态栏.
我该怎么做?
谢谢.