當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。