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


Java GuiTextField.setMaxStringLength方法代码示例

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


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

示例1: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
    super.initGui();
    this.guiLeft = (this.width - this.guiXSize) / 2;
    this.guiTop = (this.height - this.guiYSize) / 2;
    if (this.hasBackButton()) {
        back = new TextureButton(-135, this.guiLeft - 5, this.guiTop + 2, 18, 10, BOOK_EXTRAS, 1, 27, "Go back");
        this.buttonList.add(back);
    }
    if (this.hasPageLeft()) {
        left = new TextureButton(-136, this.guiLeft + 20, this.guiTop + guiYSize - 25, 18, 10, BOOK_EXTRAS, 1, 14, "Previous page");
        this.buttonList.add(left);
    }
    if (this.hasPageRight()) {
        right = new TextureButton(-137, this.guiLeft + guiXSize - 45, this.guiTop + guiYSize - 25, 18, 10, BOOK_EXTRAS, 1, 1, "Next page");
        this.buttonList.add(right);
    }
    if (hasSearchBar()) {
        search = new GuiTextField(-138, this.fontRenderer, this.guiLeft + 20, this.guiTop + 15, 128, 12);
        search.setMaxStringLength(50);
        search.setEnableBackgroundDrawing(true);
    }
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:24,代码来源:GUIBookBase.java

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

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

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

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

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

示例7: initGui

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void initGui() {
	this.xSize = 256;
	this.ySize = 216;
	labelList.clear();
	super.initGui();
	whiteListButton = new GuiButton(0, guiLeft + 10, guiTop + 72, 15, 20, "B");
	buttonList.add(whiteListButton);
	metaButton = new GuiButton(1, guiLeft + 25, guiTop + 72, 30, 20, TextFormatting.GREEN + "Meta");
	buttonList.add(metaButton);
	modButton = new GuiButton(2, guiLeft + 56, guiTop + 72, 30, 20, TextFormatting.RED + "Mod");
	buttonList.add(modButton);
	nbtButton = new GuiButton(3, guiLeft + 87, guiTop + 72, 30, 20, TextFormatting.GREEN + "NBT");
	buttonList.add(nbtButton);
	buttonSelection = new GuiButtonDefenseStationSelection(4, guiLeft + 5, guiTop + 25, te.config);
	buttonList.add(buttonSelection);
	buttonRedstone = new GuiButtonRedstoneMode(5, guiLeft + 202, guiTop + 7, te.rsMode);
	buttonList.add(buttonRedstone);
	playerButton = new GuiButton(6, guiLeft + 10, guiTop + 51, 50, 20, I18n.format("tomsmod.gui.generic"));
	buttonList.add(playerButton);
	fieldName = new GuiTextField(0, fontRenderer, guiLeft + 6, guiTop + 6, 126, 15);
	fieldName.setMaxStringLength(30);
	fieldName.setTextColor(0xffffff);
	TomsModUtils.addTextFieldToLabelList(fieldName, labelList);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:26,代码来源:GuiDefenseStation.java

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

示例9: EditableScore

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
public EditableScore(ScoreObjective original) {
	this.originalScore = original;
	nameTextField = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, 80, 0, VIRTUAL_WIDTH / 2 - 70,
			20);
	nameTextField.setMaxStringLength(16);
	if (original != null) {
		nameTextField.setText(original.getName());
	}
	displayNameTextField = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, 80, 0,
			VIRTUAL_WIDTH / 2 - 70, 20);
	displayNameTextField.setMaxStringLength(32);
	if (original != null) {
		displayNameTextField.setText(original.getDisplayName());
	}
	if (original == null) {
		scoreCriteria = IScoreCriteria.DUMMY;
	} else {
		scoreCriteria = original.getCriteria();
	}
	scoreCriteriaButton = new GuiButton(0, VIRTUAL_WIDTH / 2 + 20, 0, VIRTUAL_WIDTH / 2 - 20, 20,
			Translate.GUI_COMMANDEDITOR_SELECTSCORE_CHANGECRITERIA);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:23,代码来源:GuiSelectScore.java

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

示例11: initGui

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

	int i = (width - xSize) / 2;
	int j = (height - ySize) / 2;

	itemNameField = new GuiTextField(fontRendererObj, i + 62, j + 24, 103, 12);
	itemNameField.setTextColor(-1);
	itemNameField.setDisabledTextColour(-1);
	itemNameField.setEnableBackgroundDrawing(false);
	itemNameField.setMaxStringLength(30);
	inventorySlots.removeCraftingFromCrafters(this);
	inventorySlots.addCraftingToCrafters(this);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:18,代码来源:GuiRobitRepair.java

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

示例13: 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 + 31, guiHeight + 62, 54, 20, MekanismUtils.localize("gui.save")));
	buttonList.add(new GuiButton(1, guiWidth + 89, guiHeight + 62, 54, 20, MekanismUtils.localize("gui.delete")));

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

	filterText = new GuiTextField(fontRendererObj, guiWidth + 33, guiHeight + 48, 96, 12);
	filterText.setMaxStringLength(TileEntityOredictionificator.MAX_LENGTH);
	filterText.setFocused(true);
	
	updateButtons();
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:GuiOredictionificatorFilter.java

示例14: 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,代码来源:GuiTModIDFilter.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;
	}

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


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