当前位置: 首页>>代码示例>>Java>>正文


Java GuiTextField.setFocused方法代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiTextField.setFocused方法的典型用法代码示例。如果您正苦于以下问题:Java GuiTextField.setFocused方法的具体用法?Java GuiTextField.setFocused怎么用?Java GuiTextField.setFocused使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.gui.GuiTextField的用法示例。


在下文中一共展示了GuiTextField.setFocused方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
	buttonList.add(new GuiButton(0, width / 2 - 100, 60, "Change Key"));
	buttonList
		.add(new GuiButton(1, width / 2 - 100, height / 4 + 72, "Save"));
	buttonList
		.add(new GuiButton(2, width / 2 - 100, height / 4 + 96, "Cancel"));
	
	commandField =
		new GuiTextField(0, fontRendererObj, width / 2 - 100, 100, 200, 20);
	commandField.setMaxStringLength(65536);
	commandField.setFocused(true);
	
	if(oldCommands != null)
		commandField.setText(oldCommands);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:18,代码来源:KeybindEditorScreen.java

示例2: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
	Keyboard.enableRepeatEvents(true);
	
	buttonList.add(
		new GuiButton(0, width / 2 - 100, height / 3 * 2, 200, 20, "Done"));
	buttonList.add(new GuiButton(1, width / 2 - 100, height / 3 * 2 + 24,
		200, 20, "Cancel"));
	
	commandBox =
		new GuiTextField(0, fontRendererObj, width / 2 - 100, 60, 200, 20);
	commandBox.setMaxStringLength(100);
	commandBox.setFocused(true);
	commandBox.setText("/");
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:17,代码来源:GuiBookHack.java

示例3: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public final void initGui()
{
	Keyboard.enableRepeatEvents(true);
	
	buttonList.add(doneButton = new GuiButton(0, width / 2 - 100,
		height / 4 + 72 + 12, getDoneButtonText()));
	buttonList.add(
		new GuiButton(1, width / 2 - 100, height / 4 + 120 + 12, "Cancel"));
	buttonList.add(new GuiButton(3, width / 2 - 100, height / 4 + 96 + 12,
		"Random Name"));
	buttonList.add(stealSkinButton =
		new GuiButton(4, width - (width / 2 - 100) / 2 - 64, height - 32,
			128, 20, "Steal Skin"));
	buttonList.add(new GuiButton(5, (width / 2 - 100) / 2 - 64, height - 32,
		128, 20, "Open Skin Folder"));
	
	emailBox =
		new GuiTextField(0, fontRendererObj, width / 2 - 100, 60, 200, 20);
	emailBox.setMaxStringLength(48);
	emailBox.setFocused(true);
	emailBox.setText(getDefaultEmail());
	
	passwordBox =
		new PasswordField(fontRendererObj, width / 2 - 100, 100, 200, 20);
	passwordBox.setFocused(false);
	passwordBox.setText(getDefaultPassword());
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:29,代码来源:AltEditorScreen.java

示例4: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
	super.initGui();

	int guiWidth = (width - xSize) / 2;
	int guiHeight = (height - ySize) / 2;

	buttonList.clear();
	buttonList.add(new GuiButton(0, guiWidth + 27, guiHeight + 62, 60, 20, MekanismUtils.localize("gui.save")));
	buttonList.add(new GuiButton(1, guiWidth + 89, guiHeight + 62, 60, 20, MekanismUtils.localize("gui.delete")));

	if(isNew)
	{
		((GuiButton)buttonList.get(1)).enabled = false;
	}

	modIDText = new GuiTextField(fontRendererObj, guiWidth + 35, guiHeight + 47, 95, 12);
	modIDText.setMaxStringLength(TransporterFilter.MAX_LENGTH);
	modIDText.setFocused(true);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:22,代码来源:GuiMModIDFilter.java

示例5: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
    super.initGui();

    int xPos = (width - xSize) / 2;
    int yPos = (height - ySize) / 2;

    textField = new GuiTextField(fontRendererObj, xPos + 25, yPos + 9, 128, 12);
    textField.setFocused(true);
    textField.setCanLoseFocus(false);
    textField.setText(LayoutManager.searchField.text());
    CategoryHandler.INSTANCE.updateProjectListFromText(textField.getText());

    scrollBarXPos = xPos + SCROLLBAR_X_START_POS;
    scrollBarYPos = yPos + SCROLLBAR_Y_START_POS;
}
 
开发者ID:Dynious,项目名称:ProjectPlanner,代码行数:18,代码来源:GuiProjectPlanner.java

示例6: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
	super.initGui();
	infinite = tileEntity.infiniteMode;
	infiniteButton = new GuiSlimButton(idInfiniteButton, 9 + (width - xSize) / 2, 54 + (height - ySize) / 2, 148,
			12, infinite ? I18n.format("vendor.wrench.infiniteon") : I18n.format("vendor.wrench.infiniteoff"));
	editButton = new GuiSlimButton(idEditButton, 68 + (width - xSize) / 2, 34 + (height - ySize) / 2, 40, 12,
			I18n.format("general.button.edit"));
	applyButton = new GuiSlimButton(idApplyButton, 110 + (width - xSize) / 2, 34 + (height - ySize) / 2, 40, 12,
			I18n.format("general.button.save"));
	buttonList.clear();
	buttonList.add(editButton);
	buttonList.add(applyButton);
	buttonList.add(infiniteButton);

	blockOwnerField = new GuiTextField(0, this.fontRenderer, 12, 20, 138, 13);
	blockOwnerField.setFocused(false);
	blockOwnerField.setMaxStringLength(100);
	blockOwnerField.setText(tileEntity.blockOwner);
	blockOwnerField.setEnableBackgroundDrawing(true);
}
 
开发者ID:notabadminer,项目名称:UniversalCoins,代码行数:22,代码来源:VendorWrenchGUI.java

示例7: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
	super.initGui();

	int guiWidth = (width - xSize) / 2;
	int guiHeight = (height - ySize) / 2;

	buttonList.clear();
	buttonList.add(new GuiButton(0, guiWidth + 27, guiHeight + 62, 60, 20, MekanismUtils.localize("gui.save")));
	buttonList.add(new GuiButton(1, guiWidth + 89, guiHeight + 62, 60, 20, MekanismUtils.localize("gui.delete")));

	if(isNew)
	{
		((GuiButton)buttonList.get(1)).enabled = false;
	}

	oreDictText = new GuiTextField(fontRendererObj, guiWidth + 35, guiHeight + 47, 95, 12);
	oreDictText.setMaxStringLength(TransporterFilter.MAX_LENGTH);
	oreDictText.setFocused(true);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:22,代码来源:GuiTOreDictFilter.java

示例8: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
	super.initGui();

	int guiWidth = (width - xSize) / 2;
	int guiHeight = (height - ySize) / 2;

	buttonList.clear();
	buttonList.add(new GuiButton(0, guiWidth + 55, guiHeight + 68, 60, 20, MekanismUtils.localize("gui.confirm")));

	newPasswordField = new GuiTextField(fontRendererObj, guiWidth + 60, guiHeight + 34, 80, 12);
	newPasswordField.setMaxStringLength(12);
	newPasswordField.setFocused(true);

	confirmPasswordField = new GuiTextField(fontRendererObj, guiWidth + 60, guiHeight + 51, 80, 12);
	confirmPasswordField.setMaxStringLength(12);
	confirmPasswordField.setFocused(false);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:GuiPasswordModify.java

示例9: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
public void initGui() {
	this.buttonList.clear();
	byte var1 = -16;
	boolean var2 = true;
	
	// the center between the title and the "back to game" button
	int y = (100 + this.height / 2 + 24 + var1) / 2;
	
	this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height
			/ 2 + 24 + var1, I18n.format("Back to Game", new Object[0])));

	this.buttonList.add(new GuiButton(1, this.width / 2 - 200, y, 98, 20, I18n.format("Unmute", new Object[0])));
	this.buttonList.add(new GuiButton(2, this.width / 2 + 100, y, 98, 20, I18n.format("Mute", new Object[0])));

	_Player = new GuiTextField(this.fontRendererObj, this.width / 2 - 78, y, 150, 20);
	_Player.setFocused(true);
	_Player.setText("");

	muteList = new File("../mod_data_ChemicalStudios/" + fileName);
	
	initList();
	
	_mutedPlayers = names;
}
 
开发者ID:dylanrainwater,项目名称:Taciturn,代码行数:25,代码来源:GuiSpam.java

示例10: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    buttonList.add(new CompactButton(0, guiLeft + 47, guiTop - 5 + 20, 22, 12, "-1"));
    buttonList.add(new CompactButton(1, guiLeft + 47, guiTop - 5 + 31, 22, 12, "-10"));
    buttonList.add(new CompactButton(2, guiLeft + 12, guiTop - 5 + 20, 36, 12, "-100"));
    buttonList.add(new CompactButton(3, guiLeft + 12, guiTop - 5 + 31, 36, 12, "-1000"));
    buttonList.add(new CompactButton(4, guiLeft + 12, guiTop - 5 + 42, 57, 12, "-10000"));

    buttonList.add(new CompactButton(5, guiLeft + 122, guiTop - 5 + 20, 22, 12, "+1"));
    buttonList.add(new CompactButton(6, guiLeft + 122, guiTop - 5 + 31, 22, 2, "+10"));
    buttonList.add(new CompactButton(7, guiLeft + 143, guiTop - 5 + 20, 36, 12, "+100"));
    buttonList.add(new CompactButton(8, guiLeft + 143, guiTop - 5 + 31, 36, 12, "+1000"));
    buttonList.add(new CompactButton(9, guiLeft + 122, guiTop - 5 + 42, 57, 12, "+10000"));

    buttonList.add(new GuiThermoInvertRedstone(10, guiLeft + 70, guiTop + 33, container.remoteThermo));

    textboxHeat = new GuiTextField(fontRendererObj, 70, 16, 51, 12);
    textboxHeat.setFocused(true);
    textboxHeat.setText(container.remoteThermo.getHeatLevel().toString());
}
 
开发者ID:xbony2,项目名称:Nuclear-Control,代码行数:24,代码来源:GuiRemoteThermo.java

示例11: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
    super.initGui();
    
    _limitTextField = new GuiTextField(fontRendererObj, guiLeft + _limitTextFieldX, guiTop + _limitTextFieldY, _limitTextFieldWidth, 20);
    _limitTextField.setFocused(true);
    
    int limit = _stall.getLimitByGoodSlotIndex(_goodSlotIndex);
    
    if(limit > 0)
        _limitTextField.setText(String.valueOf(limit));
    
    Keyboard.enableRepeatEvents(true);
    
    this.buttonList.add(new GuiButton(_buttonId_applyButton, guiLeft + _applyButtonX, guiTop + _buttonY, 50, 20, StatCollector.translateToLocal("gui.StallLimit.Apply")));
    this.buttonList.add(new GuiButton(_buttonId_cancelButton, guiLeft + _cancelButtonX, guiTop + _buttonY, 50, 20, StatCollector.translateToLocal("gui.StallLimit.Cancel")));
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:19,代码来源:GuiStallLimit.java

示例12: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
    super.initGui();
    
    int w = (this.width - WindowWidth) / 2;
    int h = (this.height - WindowHeight) / 2;

    _nameTextField = new GuiTextField(fontRendererObj, w + _nameTextFieldX, h + _nameTextFieldY, _nameTextFieldWidth, 20);
    _nameTextField.setFocused(true);
    
    Keyboard.enableRepeatEvents(true);
    
    _createButton = new GuiButton(_buttonId_createButton, w + _createButtonX, h + _createButtonY, 50, 20, StatCollector.translateToLocal("gui.TrusselCreate.Create"));
    buttonList.add(_createButton);
    
    _cancelButton = new GuiButton(_buttonId_cancelButton, w + _cancelButtonX, h + _cancelButtonY, 50, 20, StatCollector.translateToLocal("gui.TrusselCreate.Cancel"));
    buttonList.add(_cancelButton);
    
    initDieMatrix(w, h);
    initWeightButtons(w, h);
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:23,代码来源:GuiTrusselCreate.java

示例13: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
@Override
public void initGui() {
    this.buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    int left = (width - xSize) / 2;
    int top = (height - ySize) / 2;

    buttonList.add(addButton = new GuiButton(0, left + 215, top + 14, 25, 20, StringUtils.translate("gui.add")));
    buttonList.add(clearUriButton = new GuiButton(1, left + 195, top + 14, 17, 20, "X"));
    buttonList.add(removeButton = new GuiButton(2, left + 4, top + 130, 42, 20, StringUtils.translate("gui.remove")));
    buttonList.add(clearButton = new GuiButton(3, left + 4, top + 100, 42, 20, StringUtils.translate("gui.clear")));
    removeButton.enabled = false;

    uriField = new GuiTextField(fontRendererObj, left + 35, top + 17, 157, fontRendererObj.FONT_HEIGHT + 5);
    uriField.setVisible(true);
    uriField.setMaxStringLength(100);
    uriField.setEnableBackgroundDrawing(true);
    uriField.setCanLoseFocus(true);
    uriField.setFocused(false);

    scrollbar = new GuiScrollbar(mc, left + 199, top + 54, 99, 0, ySize + 1, 5, 32, "playblock:textures/gui/queue_bg.png");
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:26,代码来源:GuiQueue.java

示例14: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() { // 此方法中添加控件,此方法在类每次被显示的时候被调用
	buttonList.clear(); // 添加控件前务必清除
	buttonList.add(saveButton = new GuiButton(1, width / 2 - 70,
			height - 40, 60, 20, "保存并返回"));
	buttonList.add(returnButton = new GuiButton(2, width / 2 + 10,
			height - 40, 60, 20, "取消并返回"));
	buttonList.add(reloadButton = new GuiButton(3, width / 2 - 60,
			height - 70, 120, 20, "重新载入汉化文本"));
	// 初始化textbox=========
	textOuputFileName = new GuiTextField(fontRendererObj, width / 2 - 110,
			height / 2 - 10, 200, 20);
	textOuputFileName.setFocused(false);
	textOuputFileName.setText("test"); // 设置默认文本
	Keyboard.enableRepeatEvents(true); // 注册键盘输入事件
	// 初始化结�?==========
}
 
开发者ID:tank22119,项目名称:text-operator,代码行数:18,代码来源:MainMenu.java

示例15: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    searchField = new GuiTextField(-1, fontRenderer, guiLeft + 20, guiTop + 36, 89, fontRenderer.FONT_HEIGHT);
    searchField.setMaxStringLength(15);
    searchField.setEnableBackgroundDrawing(true);
    searchField.setVisible(true);
    searchField.setFocused(true);
    searchField.setTextColor(16777215);

    updateCreativeSearch();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:18,代码来源:GuiSearcher.java


注:本文中的net.minecraft.client.gui.GuiTextField.setFocused方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。