本文整理汇总了Java中org.newdawn.slick.gui.TextField.setBorderColor方法的典型用法代码示例。如果您正苦于以下问题:Java TextField.setBorderColor方法的具体用法?Java TextField.setBorderColor怎么用?Java TextField.setBorderColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.gui.TextField
的用法示例。
在下文中一共展示了TextField.setBorderColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
@Override
public void init(final GameContainer paramGameContainer, final StateBasedGame paramStateBasedGame) throws SlickException {
game = paramStateBasedGame;
font = Resources.INSTANCE.font;
textField = new TextField(paramGameContainer, font, 100, 540, 1720 , 140);
textField.setBackgroundColor(Color.white);
textField.setBorderColor(Color.black);
textField.setText(Map.INSTANCE.getMapName());
TITLE_WIDTH = font.getWidth(TITLE);
SAVE_WIDTH = font.getWidth(SAVE);
SAVE_HEIGHT = font.getHeight(SAVE);
BACK_WIDTH = font.getWidth(BACK);
BACK_HEIGHT = font.getHeight(BACK);
save = new Rectangle(430 - (SAVE_WIDTH / 2), 800, SAVE_WIDTH, SAVE_HEIGHT);
back = new Rectangle(1290 - (BACK_WIDTH / 2), 800, BACK_WIDTH, BACK_HEIGHT);
}
示例2: set
import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
void set(int typeID, GUI gui){
this.typeID = typeID;
this.gui = gui;
gui.clear();
gc = gui.gc;
bgWidth = 600;
bgHeight = 400;
bgPosX = gc.getWidth()/2-bgWidth/2;
bgPosY = gc.getHeight()/2-bgHeight/2;
this.bg = new Rectangle(bgPosX, bgPosY, bgWidth, bgHeight);
this.border = new Rectangle(gc.getWidth()/2-(bgWidth+5)/2, gc.getHeight()/2-(bgHeight+5)/2, bgWidth, bgHeight);
si = items.get(typeID);
cats = si.getCategories();
int strHeight = fontSmall.getHeight("A"),
titleHeight = fontTitle.getHeight("A"),
x = bgPosX+10,
y = bgPosY+titleHeight+15;
for (String cat : cats){
gui.drawText(cat, x, y, fontSmall, Color.white);
y+=strHeight;
}
gui.drawText("X", bgPosX+bgWidth-20, bgPosY+5, fontSmall, Color.white);
amount = new TextField(gc, fontSmall, 0, 0, 150, 40);
amount.setBackgroundColor(new Color(0, 0, 0, 50));
amount.setBorderColor(Color.transparent);
amount.setTextColor(Color.white);
amount.setMaxLength(253);
amount.setFocus(true);
amount.isAcceptingInput();
closeChooseAmount();
isSet = true;
}
示例3: init
import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
@Override
public void init(GameContainer gc, final StateBasedGame sbg) throws SlickException {
bg = new Image("res/bg.png");
logo = new Image("res/logo.png");
try {
awtFontTitle = Game.awtFontTitle.deriveFont(40f); // set font size
titleFont = new TrueTypeFont(awtFontTitle, true);
awtFont = Game.awtFont.deriveFont(30f); // set font size
font = new TrueTypeFont(awtFont, true);
} catch (Exception e) {
e.printStackTrace();
}
IPinput = new TextField(gc, font, 0, 0, 350, 50);
IPinput.setBackgroundColor(new Color(0, 0, 0, 50));
IPinput.setBorderColor(Color.transparent);
IPinput.setTextColor(Color.white);
IPinput.setMaxLength(253);
IPinput.setText(Game.prefs.get(Game.pref_lastip, ""));
IPinput.setCursorPos(IPinput.getText().length());
nameField = new TextField(gc, font, 0, 0, 350, 50);
nameField.setBackgroundColor(new Color(0, 0, 0, 50));
nameField.setBorderColor(Color.transparent);
nameField.setTextColor(Color.white);
nameField.setMaxLength(20);
nameField.setText(Game.prefs.get(Game.pref_playername, Game.default_username));
nameField.setCursorPos(nameField.getText().length());
// Net
Game.network = new Network(gc, sbg);
}
示例4: init
import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
@Override
public void init(final GameContainer paramGameContainer, final StateBasedGame paramStateBasedGame) throws SlickException {
game = paramStateBasedGame;
font = Resources.INSTANCE.font;
font2 = paramGameContainer.getDefaultFont();
xField = new TextField(paramGameContainer, font2, 510, 540, 300 , 140);
xField.setBackgroundColor(Color.black);
xField.setBorderColor(Color.white);
xField.setText("22");
xField.setMaxLength(2);
yField = new TextField(paramGameContainer, font, 1060, 540, 300 , 140);
yField.setBackgroundColor(Color.black);
yField.setBorderColor(Color.white);
yField.setText("22");
yField.setMaxLength(2);
TITLE_X = font.getWidth(TITLE) / 2;
OK_X = font.getWidth(OK);
OK_Y = font.getHeight(OK);
BACK_X = font.getWidth(BACK);
BACK_Y = font.getHeight(BACK);
X_X = font.getWidth(X) / 2;
REASON_X = font.getWidth(reason) / 2;
ok = new Rectangle(1260 - (OK_X / 2), 800, OK_X, OK_Y);
back = new Rectangle(660 - (BACK_X / 2), 800, BACK_X, BACK_Y);
}