• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.lessvoid.nifty.controls.TextField的典型用法代码示例。如果您正苦于以下问题:Java TextField类的具体用法?Java TextField怎么用?Java TextField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextField类属于de.lessvoid.nifty.controls包,在下文中一共展示了TextField类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: show

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
public void show(Nifty nifty, final String message) {
    this.nifty = nifty;

    ScreenBuilder builder;
    if (Constants.android) {
        builder = createAndroid(message);
    } else {
        builder = createDesktop(message);
    }
    Screen scr = builder.build(nifty);

    textField = scr.findNiftyControl("textField", TextField.class);

    nifty.addScreen(SCREEN_ID, scr);
    nifty.gotoScreen(SCREEN_ID);
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:17,代码来源:TextinputDialog.java


示例2: bind

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
@Override
public void bind(Nifty nifty, Screen screen) {
    super.bind(nifty, screen);
    // login
    tfEmail = (TextField) nifty.getScreen("start").
            findNiftyControl("tfEmail", TextField.class);
    tfPassword = (TextField) nifty.getScreen("start").
            findNiftyControl("tfPassword", TextField.class);
    lbCheck = (Label) nifty.getScreen("start").
            findNiftyControl("lbCheck", Label.class);
    // register
    tfRegName = (TextField) nifty.getScreen("start").
            findNiftyControl("tfRegName", TextField.class);
    tfRegEmail = (TextField) nifty.getScreen("start").
            findNiftyControl("tfRegEmail", TextField.class);
    tfRegPassword = (TextField) nifty.getScreen("start").
            findNiftyControl("tfRegPassword", TextField.class);
    tfRegPassword2 = (TextField) nifty.getScreen("start").
            findNiftyControl("tfRegPassword2", TextField.class);
    lbRegCheck = (Label) nifty.getScreen("start").
            findNiftyControl("lbRegCheck", Label.class);
}
 
开发者ID:duodecimo,项目名称:magicallyous,代码行数:23,代码来源:MagicallyousScreenController.java


示例3: onStartScreen

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
@Override
public void onStartScreen() {
	textfieldChat = screen.findNiftyControl("textfieldChat", TextField.class);
	panelToolTip = screen.findElementByName("panelToolTip");
	layerHUD = screen.findElementByName("layerHUD");
	panelPortal = screen.findElementByName("panelPortal");
	
	panelPortal.hide();
	
	for (Element e : notificationElements) {
		recursiveElementRemoval(nifty, screen, e);
	}
	
	notificationElements.clear();
	notificationControls.clear();
	
	Iterator<Message> itr = messages.iterator();
	while (itr.hasNext()) {
		Message m = itr.next();
		m.remove();
		itr.remove();
	}
	
	screen.getFocusHandler().setKeyFocus(null);
}
 
开发者ID:AMPBEdu,项目名称:gjOryx,代码行数:26,代码来源:WorldScreen.java


示例4: startGame

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
public void startGame() {
	//TODO: without a player one cannot start
	String mapName = screen.findElementById("mapNameLabel").getRenderer(TextRenderer.class).getOriginalText();
	List<Element> children = playerScrollPanelPanel.getChildren();
	ArrayList<Player> players = new ArrayList<Player>();
	for (int i = 0; i < children.size(); i++) {
		Element child = children.get(i);
		String name = child.findNiftyControl("player" + i + "TextField", TextField.class).getDisplayedText();
		if (child.findElementById("player" + i + "Label").getRenderer(TextRenderer.class).getOriginalText().equals("AI:")) {
			System.err.println("AI not implemented yet. " + name + " excluded from Players.");
			continue;
		}
		Color colorNifty = screen.findElementById("color" + i).getRenderer(PanelRenderer.class).getBackgroundColor();
		org.newdawn.slick.Color colorSlick = new org.newdawn.slick.Color(colorNifty.getRed(), colorNifty.getGreen(), colorNifty.getBlue(), colorNifty.getAlpha());
		int team = Integer.parseInt(screen.findNiftyControl("team" + i, Button.class).getText().substring(5))-1;
		players.add(new Player(name, colorSlick, team));
	}

	Player[] player = new Player[players.size()];
	player = players.toArray(player);
	NiftyMenu.startGame(new Controller(MapList.getInstance().getMap(mapName), player, "Conquest"));
}
 
开发者ID:oberien,项目名称:Oberien,代码行数:23,代码来源:GameSetupScreenController.java


示例5: connect

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
public void connect() {
    String username =
            screen.findNiftyControl("username_text", TextField.class)
            .getDisplayedText();

    if (username.trim().length() == 0) {
        setStatusText("Username is invalid");
        return;
    }

    int port = Integer.parseInt(screen.findNiftyControl("server_port",
            TextField.class).getDisplayedText());
    String address = screen.findNiftyControl("server_ip",
            TextField.class).getDisplayedText();

    setStatusText("Connecting... " + username);

    ClientMain clientMain = (ClientMain) Globals.app;
    clientMain.connect(username, address, port);
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:21,代码来源:ConnectionMenu.java


示例6: applyGraphicsSettings

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
public void applyGraphicsSettings() {
    TextField freeCameraSpeedField = nifty.getCurrentScreen()
            .findNiftyControl("free_camera_speed", TextField.class);
    String freeCameraSpeedString = freeCameraSpeedField.getDisplayedText();
    try {
        float freeCamSpeed = Integer.parseInt(freeCameraSpeedString);
        if (freeCamSpeed > 0f) {
            ClientSettings.setFreeCameraSpeed(freeCamSpeed);
        }
    } catch (NumberFormatException e) {
        // TODO: Show error message
    }
    try {
        appSettings.save(ClientMain.PREFERENCES_KEY);
    } catch (BackingStoreException ex) {
        Logger.getLogger(ClientSettings.class.getName()).log(Level.SEVERE,
                "Failed to save graphic settings", ex);
    }
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:20,代码来源:ClientSettings.java


示例7: bind

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
@Override
public void bind(Nifty nifty, Screen screen) {
    try {
        if (screen.getScreenId().equals("start")) {
            molField = screen.findNiftyControl("molecule", TextField.class);
            molField.setText(getHistoryMolecule());
        }
    } catch (Exception ex) {
        logger.log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:12,代码来源:NiftyAppState.java


示例8: onStartScreen

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
@Override
public void onStartScreen() {
	TextField email = screen.findNiftyControl("emailField", TextField.class);
	email.setText(SettingsState.getSingleton().username);
	//email.setText("");
	if (email.getText().length() > 0) {
		screen.getFocusHandler().setKeyFocus(screen.findNiftyControl("passwordField", TextField.class).getElement());
	}
	TextField password = screen.findNiftyControl("passwordField", TextField.class);
	//password.setText("");
}
 
开发者ID:AMPBEdu,项目名称:gjOryx,代码行数:12,代码来源:LoginScreen.java


示例9: selectGame

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
public void selectGame() {
    ListBox listbox = screen.findNiftyControl("lb_games", ListBox.class);
    
    if (listbox.getSelection().isEmpty()) {
        return;
    }
    
    Game selection = (Game) listbox.getSelection().get(0);
    screen.findNiftyControl("server_ip", TextField.class)
            .setText(selection.address);
    screen.findNiftyControl("server_port", TextField.class)
            .setText("" + selection.port);
    closeGameList();
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:15,代码来源:ConnectionMenu.java


示例10: bind

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
public void bind(Nifty nifty, Screen screen) {
    this.nifty = nifty;
    this.screen = screen;

    TextField freeCameraSpeedTextField = screen
            .findNiftyControl("free_camera_speed", TextField.class);
    freeCameraSpeedTextField
            .setText(String.valueOf((int) getFreeCameraSpeed()));
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:10,代码来源:ClientSettings.java


示例11: bind

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
@Override
public void bind(Nifty nifty, Screen screen) {
    this.loginField = screen.findNiftyControl("login", TextField.class);
    this.passField = screen.findNiftyControl("pass", TextField.class);
}
 
开发者ID:LeNiglo,项目名称:TinyTank,代码行数:6,代码来源:WindowLogin.java


示例12: chatFocused

import de.lessvoid.nifty.controls.TextField; //导入依赖的package包/类
/**Returns whether the chat text area currently has focus
 *
 * @return true if the chat text area has focus, false otherwise
 */
public boolean chatFocused(){
	TextField tf = nifty.getScreen("hud").findNiftyControl("chatText",TextField.class);
	return tf.hasFocus();
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:9,代码来源:HudScreenController.java



注:本文中的de.lessvoid.nifty.controls.TextField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Collator类代码示例发布时间:2022-05-22
下一篇:
Java LinAlgHelpers类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap