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


Java GuiTextField.setText方法代码示例

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


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

示例1: initGui

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

        Keyboard.enableRepeatEvents(true);

        this.guiLeft = (this.width - this.xSize) / 2;
        this.guiTop = (this.height - this.ySize) / 2;

        channelName = new GuiTextField(0, mc.fontRenderer, this.guiLeft + 7, this.guiTop + 17, 80, mc.fontRenderer.FONT_HEIGHT + 4);
        channelName.setMaxStringLength(15);
        channelName.setTextColor(16777215);
        channelName.setText(terminal.channelName.isEmpty() ? "" : terminal.channelName.substring(terminal.channelName.indexOf(":") + 1));

        isPublicChannel = !terminal.channelName.isEmpty() && terminal.channelName.contains("public");

        buttonList.clear();
        buttonList.add(new GuiButton(ID_CONFIRM, guiLeft + (xSize - 50) / 2, guiTop + ySize + 2, 50, 20, I18n.translateToLocal("gui.done")));
        buttonList.add(new GuiButton(ID_PUBLIC_CHANNEL, guiLeft + 6, guiTop + 47, 82, 20, I18n.translateToLocal(isPublicChannel ? "gui.yes" : "gui.no")));
    }
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:23,代码来源:GuiChannelSetter.java

示例2: 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

示例3: 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

示例4: 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

示例5: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
	ySize = 176;
	xSize = 210;
	labelList.clear();
	super.initGui();
	fieldName = new GuiTextField(0, fontRenderer, guiLeft + 6, guiTop + 6, 50, 10);
	fieldName.setMaxStringLength(30);
	fieldName.setTextColor(0xffffff);
	TomsModUtils.addTextFieldToLabelList(fieldName, labelList);
	if (entry != null)
		fieldName.setText(entry.getName());
	offsetX = new GuiNumberValueBox(0, guiLeft + 5, guiTop + 20, 32, -32);
	offsetY = new GuiNumberValueBox(1, guiLeft + 5, guiTop + 30, 32, -32);
	offsetZ = new GuiNumberValueBox(2, guiLeft + 5, guiTop + 40, 32, -32);
	offsetX.addToList(buttonList);
	offsetY.addToList(buttonList);
	offsetZ.addToList(buttonList);
	offsetX.num = entry.getOffsetX();
	offsetY.num = entry.getOffsetY();
	offsetZ.num = entry.getOffsetZ();
	TomsModUtils.addNumberValueBoxToLabelList(offsetX, labelList);
	TomsModUtils.addNumberValueBoxToLabelList(offsetY, labelList);
	TomsModUtils.addNumberValueBoxToLabelList(offsetZ, labelList);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:26,代码来源:GuiProjectorLensConfigurationMain.java

示例6: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
  Keyboard.enableRepeatEvents(true);
  accountsgui = new GuiAccountSelector.List(this.mc);
  accountsgui.registerScrollButtons(5, 6);
  query = I18n.format("ias.search");
  this.buttonList.clear();
  //Above Top Row
  this.buttonList.add(reloadskins = new GuiButton(8, this.width / 2 - 154 - 10, this.height - 76 - 8, 120, 20, I18n.format("ias.reloadskins")));
  //Top Row
  this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 40, this.height - 52, 120, 20, I18n.format("ias.addaccount")));
  this.buttonList.add(login = new GuiButton(1, this.width / 2 - 154 - 10, this.height - 52, 120, 20, I18n.format("ias.login")));
  this.buttonList.add(edit = new GuiButton(7, this.width / 2 - 40, this.height - 52, 80, 20, I18n.format("ias.edit")));
  //Bottom Row
  this.buttonList.add(loginoffline = new GuiButton(2, this.width / 2 - 154 - 10, this.height - 28, 110, 20, I18n.format("ias.login") + " " + I18n.format("ias.offline")));
  this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 28, 110, 20, I18n.format("gui.cancel")));
  this.buttonList.add(delete = new GuiButton(4, this.width / 2 - 50, this.height - 28, 100, 20, I18n.format("ias.delete")));
  search = new GuiTextField(8, this.fontRenderer, this.width / 2 - 80, 14, 160, 16);
  search.setText(query);
  updateButtons();
  if (!queriedaccounts.isEmpty())
    SkinTools.buildSkin(queriedaccounts.get(selectedAccountIndex).alias);
}
 
开发者ID:The-Fireplace-Minecraft-Mods,项目名称:In-Game-Account-Switcher,代码行数:24,代码来源:GuiAccountSelector.java

示例7: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
@SuppressWarnings("unchecked")
@Override
public void initGui() {
    Keyboard.enableRepeatEvents(true);
    buttonList.clear();
    buttonList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12, "Search"));
    buttonList.add(new GuiButton(1, width / 2 - 100, height / 4 + 120 + 12, "Back"));
    ipBox = new GuiTextField(0, fontRendererObj, width / 2 - 100, height / 4 + 34, 200, 20);
    ipBox.setMaxStringLength(15);
    ipBox.setFocused(true);
    maxThreadsBox = new GuiTextField(1, fontRendererObj, width / 2 - 32, height / 4 + 58, 26, 12);
    maxThreadsBox.setMaxStringLength(3);
    maxThreadsBox.setFocused(false);
    maxThreadsBox.setText(Integer.toString(WurstClient.INSTANCE.options.serverFinderThreads));
    running = false;
    terminated = false;
    WurstClient.INSTANCE.analytics.trackPageView("/multiplayer/server-finder", "Server Finder");
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:22,代码来源:GuiServerFinder.java

示例8: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui()
{
    // Called when the gui should be (re)created
    // Sidebar buttons for now
    this.buttonList.add( new GuiButton( 100, (width / 2) + 78, height / 2 - 60, 120, 20, I18n.format("xray.single.delete") ));
    this.buttonList.add( new GuiButton( 101, (width / 2) + 78, height / 2 - 38, 120, 20, I18n.format("xray.input.change_meta") ));

    this.buttonList.add( new GuiButton( 98, (width / 2) + 78, height / 2 + 58, 120, 20, I18n.format("xray.single.save") ));

    // Bottom buttons
    this.buttonList.add( new GuiButton( 99, width / 2 - 138, height / 2 + 83, 202, 20, I18n.format("xray.single.cancel") ) ); // Cancel button

    this.buttonList.add( redSlider = new GuiSlider( 3, width / 2 - 138, height / 2 + 7, I18n.format("xray.color.red"), 0, 255 ));
    this.buttonList.add( greenSlider = new GuiSlider( 2, width / 2 - 138, height / 2 + 30, I18n.format("xray.color.green"), 0, 255 ));
    this.buttonList.add( blueSlider = new GuiSlider( 1, width / 2 - 138, height / 2 + 53, I18n.format("xray.color.blue"), 0, 255 ) );

    redSlider.sliderValue   = (float)oreInfo.color[0]/255;
    greenSlider.sliderValue = (float)oreInfo.color[1]/255;
    blueSlider.sliderValue  = (float)oreInfo.color[2]/255;

    oreName = new GuiTextField( 1, this.fontRenderer, width / 2 - 138 ,  height / 2 - 63, 202, 20 );
    oreName.setText(this.oreInfo.getDisplayName());

}
 
开发者ID:MichaelHillcox,项目名称:XRay-Mod,代码行数:26,代码来源:GuiEditOre.java

示例9: initGui

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

    // new GuiTextField(FontRenderer, x, y, width, height).
    mCodenameField = new GuiTextField(this.fontRendererObj, (width - 200) / 2, 20, 200, 20);
    mCodenameField.setFocused(true);
    mCodenameField.setText("");

    // new GuiButton(id, x, y, (width, height, )String).
    mResistanceButton = new GuiButton(ID_RESISTANCE_BUTTON, (width - 200) / 2, height - 80 - 20, 200, 20, "RESISTANCE");
    mEnlightenedButton = new GuiButton(ID_ENLIGHTENED_BUTTON, (width - 200) / 2, height - 60 - 10, 200, 20, "ENLIGHTENED");
    mCancelButton = new GuiButton(ID_CANCEL_BUTTON, (width - 200) / 2, height - 40, 200, 20, "#你怎么还在玩这个游戏");

    buttonList.add(mResistanceButton);
    buttonList.add(mEnlightenedButton);
    buttonList.add(mCancelButton);

}
 
开发者ID:evshiron,项目名称:IngressCraft,代码行数:19,代码来源:GUICreateScanner.java

示例10: 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

示例11: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
	super.initGui();
	buttonOne = new GuiSlimButton(idButtonOne, 8 + (width - xSize) / 2, 30 + (height - ySize) / 2, 18, 12, "");
	buttonTwo = new GuiSlimButton(idButtonTwo, 8 + (width - xSize) / 2, 50 + (height - ySize) / 2, 18, 12, "");
	buttonThree = new GuiSlimButton(idButtonThree, 8 + (width - xSize) / 2, 70 + (height - ySize) / 2, 18, 12, "");
	buttonFour = new GuiSlimButton(idButtonFour, 8 + (width - xSize) / 2, 90 + (height - ySize) / 2, 18, 12, "");
	buttonList.clear();
	buttonList.add(buttonOne);
	buttonList.add(buttonTwo);
	buttonList.add(buttonThree);
	buttonList.add(buttonFour);

	textField = new GuiTextField(0, this.fontRenderer, 1, 1, 100, 13);
	textField.setFocused(false);
	textField.setMaxStringLength(9);
	textField.setText("0");
}
 
开发者ID:notabadminer,项目名称:UniversalCoins,代码行数:19,代码来源:ATMGUI.java

示例12: initGui

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

    text = new GuiTextField(getFontRenderer(), guiLeft + 7, guiTop + 18, 162, 20);
    text.setText(ProxyClient.saveName);
    text.setCursorPosition(0);

    display = new ElementGlyphDisplay(this, 7, 52, ProxyClient.saveGlyph);
    addElement(display);

    buttonList.add(new GuiButton(0, guiLeft + 7, guiTop + ySize - 27, 80, 20, Localisation.get(EPMod.ID, Locale.GUI_CANCEL)));
    buttonList.add(new GuiButton(1, guiLeft + xSize - 87, guiTop + ySize - 27, 80, 20, Localisation.get(EPMod.ID, Locale.GUI_SAVE)));

    buttonList.add(new GuiButton(100, guiLeft + 57, guiTop + 83, 20, 20, ""));
    buttonList.add(new GuiButton(101, guiLeft + xSize / 2 - 10, guiTop + 83, 20, 20, ""));
    buttonList.add(new GuiButton(102, guiLeft + 99, guiTop + 83, 20, 20, ""));
}
 
开发者ID:enhancedportals,项目名称:enhancedportals,代码行数:19,代码来源:GuiDialingAdd.java

示例13: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
  Keyboard.enableRepeatEvents(true);
  super.initGui();
  int width = 127, height = 20;
  int x = (xSize / 2 - width / 2), y = 26 + (height / 2);
  txtPassword = new GuiTextField(0, this.fontRenderer, x, y, width, height);
  txtPassword.setMaxStringLength(40);
  txtPassword.setText(ctr.tile.getMyPassword());
  txtPassword.setFocused(true);
  x = this.guiLeft - 82;
  y = this.guiTop;
  buttonActiveType = new ButtonPassword(PacketType.ACTIVETYPE, x, y);
  this.addButton(buttonActiveType);
  y += height + 4;
  buttonUserClaim = new ButtonPassword(PacketType.USERCLAIM, x, y);
  this.addButton(buttonUserClaim);
  y += height + 4;
  buttonUserPerm = new ButtonPassword(PacketType.USERSALLOWED, x, y);
  this.addButton(buttonUserPerm);
  updateVisibility();
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:23,代码来源:GuiPassword.java

示例14: EditableTeam

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
public EditableTeam(ScorePlayerTeam originalTeam) {
	this.originalTeam = originalTeam;
	nameTextField = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, 80, 0, VIRTUAL_WIDTH / 2 - 70,
			20);
	nameTextField.setMaxStringLength(16);
	if (originalTeam != null) {
		nameTextField.setText(originalTeam.getRegisteredName());
	}
	displayNameTextField = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, 80, 0,
			VIRTUAL_WIDTH / 2 - 70, 20);
	displayNameTextField.setMaxStringLength(32);
	if (originalTeam != null) {
		displayNameTextField.setText(originalTeam.getTeamName());
	}
	if (originalTeam == null) {
		options = new TeamOptions();
	} else {
		options = new TeamOptions(originalTeam);
	}
	optionsButton = new GuiButton(0, VIRTUAL_WIDTH / 2 + 20, 0, VIRTUAL_WIDTH / 2 - 20, 20,
			Translate.GUI_COMMANDEDITOR_SELECTTEAM_OPTIONS);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:23,代码来源:GuiSelectTeam.java

示例15: 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;
	}

	minField = new GuiTextField(fontRendererObj, guiWidth + 149, guiHeight + 19, 20, 11);
	minField.setMaxStringLength(2);
	minField.setText("" + filter.min);

	maxField = new GuiTextField(fontRendererObj, guiWidth + 149, guiHeight + 31, 20, 11);
	maxField.setMaxStringLength(2);
	maxField.setText("" + filter.max);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:26,代码来源:GuiTItemStackFilter.java


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