Menu
  • HOME
  • TAGS

Java JTextfield gives me only null data

java,swing,frame,textfield

The reason you are getting this problem is because you have created a new local variable with the same name as one of your class member variables: TextField tf_name_input = new TextField(); instead of: tf_name_input = new TextField(); ...

focusing a text field in swift

ios,swift,textfield

This works for me: import UIKit class ViewController:UIViewController, UITextFieldDelegate { @IBOutlet weak var fNameField: UITextField! @IBOutlet weak var sNameField: UITextField! @IBOutlet weak var emailField: UITextField! @IBOutlet weak var passwordField: UITextField! override func viewDidLoad() { super.viewDidLoad() fNameField.delegate = self sNameField.delegate = self emailField.delegate = self passwordField.delegate = self } func isValidEmail...

Sencha ExtJS: How do I prevent the cursor from leaving the current position in a phone number field upon edit?

extjs,sencha-touch,textfield,phone

I have figured it out. The problem was fixed by deleting this segment: onChange: function (c) { c.setValue(Ext.util.Format.phoneNumber(c.getValue())); } The field still validates the number until it matches the format criteria. Cannot save until it matches. :D...

Comma Automatically Being Added to TextField in Swift

swift,numbers,textfield,comma

In your storyboard select the artSizeTextField and remove its formatter.

Disable Hyperlinks inside TextFields from opening web browser

actionscript-3,flash,hyperlink,textfield

TL;DR version: The ONLY reason the web browser will pop open, whether in Flash Player or in AIR, is that you forgot to add event: to the start of your anchor href. The full explanation: You do NOT need to use event.preventDefault() or event.stopPropagation() to prevent the web browser from...

Output a string to a textfield javafx using scenebuilder [closed]

java,javafx,output,textfield,scenebuilder

TextField inherits both the getText() and setText() methods from TextInputControl. You could try something like: textFieldToSet.setText(textFieldContainingString.getText()); In this case, you would be setting the text of textFieldToSet to whatever String is currently contained within textFieldContainingString....

Changing prompt text for JavaFX textfield

javafx,textfield

Instead of reassigning the textfield variable to a new TextField object (via textfield = new TextField(newPrompt);), use the TextField's setPromptText(String s) method in your ChangeListener: final ChoiceBox<String> box = ...; //choicebox created and filled box.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { textfield.setPromptText("New...

Basic String Issue

java,string,textfield

You can save it as a class variable like this: class myClass{ public static String input1 = ""; <--- EDIT //Rest of code } You can access this by myClass.input1. And for the int value use: Integer.parseInt(input1) ...

Getting “infinity” value from textfield on android

android,android-fragments,textfield,calculator,infinity

Use this: Integer.parseInt(etBodyWeight.getText().toString()); instead of: Integer.parseInt(etBodyWeight.toString()); Also see the answer here for getting value from EditText. Also change to etWaist.getText().toString()....

Fill HTML-textfield-value with PHP $_GET-parameter

php,html,input,get,textfield

Please remove '&' After '?' and in input field write: <input type="text" value="<?php echo $_GET['textfieldvalue'] ?>" required /> ...

Swift: Problems with getting text from UIAlertView textfield

ios,swift,alert,uialertview,textfield

You may go with UIAlertController instead of UIAlertView. I've already implemented and tested too using UIAlertController for what you actually want. Please try the following code var tField: UITextField! func configurationTextField(textField: UITextField!) { println("generating the TextField") textField.placeholder = "Enter an item" tField = textField } func handleCancel(alertView: UIAlertAction!) { println("Cancelled...

How to show a notification to the user if a textfield is left blank

java,input,textfield

In the button's ActionListener: if (textField.getText().isEmpty()) { JOptionPane.showMessageDialog(textField, "Beware: you left the text field blank"); } else { proceedAsUsual(); } ...

Android start activity when user enters value in edit text

android,textfield

An easier way that I ended up doing was starting an activity for result once the textfield got activated and the setting the value once the new completed

a web application having three textbox under one Label “Full Name”.

sql,label,textfield

This is the code to create your FullName table. CREATE TABLE FullName ( id int identity primary key, FName varchar(20), MName varchar(20), LName varchar(20) ); Note: The column "id" was added to uniquely identify each row within your table. There is always a possibility you would have two or more...

Adding a listener on a Wicket TextField

java,wicket,textfield,wicketstuff

Try with an AjaxEventBehavior("change") on your NumberField. For anything more serious you'll have to add the behavior to the wrapped numberInput.

Binding the text of a TextField to some object (JavaFX)

java,textfield,onchange,javafx-8

Well, that was kind of stupid... The listener have to be added to the textProperty, resulting in an obvious code (in TemplateForm) : // t is an instance of Template final Map<String,String> params = t.getParameters(); Iterator<Map.Entry<String,String>> it = params.entrySet().iterator(); Map.Entry<String,String> param; int i; for (i=0, param = it.hasNext() ? it.next()...

ios/xcode/coredata: How to mimic ajax call in objective c

ios,core-data,tags,textfield

You could try a third party development in order to make what you want. In a recent project I have used this one: https://github.com/EddyBorja/MLPAutoCompleteTextField...

Unity3D gui form text too small

user-interface,unity3d,textfield,unityscript

You can use GUIStyle to change the font size. function OnGUI() { var style : GUIStyle = new GUIStyle(); style.fontSize = 25; GUI.Label( Rect ( Screen.width/2 - 20, Screen.height/2, 80, 20), "Name:", style); } ...

AutoComplete-devbridge: update params on change from other autocomplete field

jquery,autocomplete,textfield,jquery-autocomplete

Because your variables are strings, they are passed as values and not a reference. When data in the "#add" changes you need to update parameters on "#name" input autocomplete instance: $('#add').change(function() { var add = $('#add').val(); $('#name').devbridgeAutocomplete().setOptions({ params: { add: add } }); }); ...

Infield calculations using document.getElementById not working

javascript,input,textfield,calculator

Basic Fixes There are many issues in your markup and code, starting with @Pointy's comment regarding your regexp. In the following, updated, working version, I have commented inline to explain these issues: function Calculate_Value(row) { // NOTE: Settle on the regexp approach to use – i.e. /.../ or // new...

ios/xcode/objective c: Capture last keystroke in textfield

ios,textfield,ontouchevent

What I do is to assign the text field a delegate. In this case, the delegate would whatever is the instance whose class's code you have shown in your question. The delegate is sent a bunch of delegate messages, documented in UITextFieldDelegate. In this case, the one I would use...

Swift - Get keyboard input as the user is typing

ios,swift,keyboard,textfield,keyboard-input

You need to register as observer for notifications to see when the keyboard appears and disappears. Then you would move your view up on show, or restore it to original on hide. My implementation moves the whole view up by keyboard height, but if you want you can just move...

How to save dynamically-added input fields to a hash?

ruby-on-rails,input,hash,textfield,params

try something like this <%= form_for @campaign do |f| %> <%= f.label :name, "name" %> <%= f.text_field :name %> <%= f.label :"custom_payouts[][:username]", "Username" %> <%= text_field_tag "campaign[custom_payouts][][:username]" %> <%= f.label :"custom_payouts[][:percentage]", "Percentage" %> <%= text_field_tag "campaign[custom_payouts][][:percentage]" %> <% end %> ...

Django: show newlines from admin site?

python,html,django,newline,textfield

Use the linebreaks template filter.

Different borders on each side of a TextField

css,javafx,textfield,scenebuilder

You can specify 4 values in -fx-border-color, and they will be the colors of the top, right, bottom and left border, respectively. -fx-border-color: red green blue yellow; See -fx-border-color in JavaFX CSS reference....

as3 dynamically loaded font undefined fontname

actionscript-3,format,undefined,textfield,textformat

You should instantiate the font and access the fontName instance property: var font:NumberFont = new NumberFont(); var tFormat:TextFormat = new TextFormat(font.fontName); ...

Round corners in textfield extjs

css,extjs,styles,textfield

I managed to acheive this by adding a class and adding specific CSS rules below. Most obvious methods didn't seem to work for me. items: [{ fieldLabel: 'First Name', name: 'first', allowBlank: false }, { fieldLabel: 'Last Name', name: 'last', allowBlank: false, cls: 'rounded' }], <style> .rounded .x-form-text-wrap, .rounded .x-form-trigger-wrap...

Saving a text from UIAlertView

save,uialertview,textfield

Here you go good sir. Per your comment above, if you want to store data for NSUserDefaults here is how you would do it: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString* saveData = [[newreference textFieldAtIndex:0] text]; [defaults setObject:saveData forKey:@"whatever key you want here"]; [defaults synchronize]; Then to invoke or call it:...

How Vaadin translates &Address to Alt+A using shortcut by a shorthand notation in AbstractField.FocusShortcut?

java,keyboard-shortcuts,vaadin,textfield,shorthand

From the ShortcutAction javadocs: Insert one or more modifier characters before the character to use as keycode. E.g "&Save" will make a shortcut responding to ALT-S, "E^xit" will respond to CTRL-X. Multiple modifiers can be used, e.g "&^Delete" will respond to CTRL-ALT-D (the order of the modifier characters is not...

GXT3 - TextField height. How to make a TextFields height bigger?

java,gwt,height,textfield,gxt

I have found a CSS-free solution myself. But thanks to geert3 for his suggestion to look into the html itself to determine what component have to be adjusted to visualize the correct height. In the end the "input" field have to be modified. For this purpose I have written a...

How to display TextField at the bottom of the screen

qml,textfield,qtquick2,sailfish-os

Kaymaz, in common, your question is not related to SailfishOS. And you was almost right, but made several errors in your code. You can use this code: // Its desktop version, and everyone can run it. It will be easy // to insert correct includes for SailfishOS import QtQuick 2.3...

How to build a delete button to remove a character from the TextField every time delete button is clicked?

java,javafx,textfield,javafx-8

A solution for your problem is to use focusedProperty to save , when newValue is true, on a generic TextField txt the TextField focused ... view this example code: @FXML TextField tf1; @FXML TextField tf2; @FXML TextField tf3; TextField txt; @FXML public void btnDelete(ActionEvent actionEvent) { txt.setText( txt.getText().substring(0, txt.getText().length()-1)); }...

Formating decimal on fly on a TextField iOS7 Xcode5

ios7,decimal,textfield

it does the job for you, shame on me I could have done it better, but I hope someone can give you a more elegant solution for this issue. (e.g. using regexp or something) - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ NSNumberFormatter *_formatter = [[NSNumberFormatter alloc] init]; [_formatter setNumberStyle:NSNumberFormatterDecimalStyle]; NSMutableString *_pureNumber...

Disabling Button while TextFields empty not working

button,javafx,javafx-2,textfield

If you want the Button to be active if and only if all fields are filled (i.e. not empty), then you are using the wrong operator. Use || instead of && to make it work. You can easyly see what's wrong, if you reformulate the formula from computeValue using DeMorgan's...

Java Calculation Mistake

java,textfield

If your user is supposed to be inputting the interest rate as a percentage, you need to divide it by 100 as part of your calculation. E.g. double x = (Double.parseDouble(AnnualInterestRate.getText())/1200) + 1; Output: $1138.43...

How to get values in this json object in ext js?

json,extjs,textfield

Because response.info is a root level node in your response which contains an array of objects: [{"name":"name","another":"another"}] So to use a value from this object in the text box (as it needs a string value) you need to access the object in this array and then extract the value from...

How do I only allow numbers in a JTextField using a KeyEvent?

java,swing,formatting,textfield,keyevent

Try replacing your if (Mile of tests) with: if(c < '0' || c > '9') evt.consume(); or, the more readable, as azurefrog pointed out: if(!Character.isDigit(c)) evt.consume(); ...

iOS - get text value from array of UITextFields

ios,objective-c,arrays,textfield

Using a for-in loop seems the easiest if the goal is just to compare an array of strings to see if they are empty: for(NSString * text in textEingabe){ if( [text isEqualToString:@""] ){ //something } else{ //something else } } ...

A loading image using Vaadin components

javascript,css,vaadin,textfield

You missunderstand the behaviour of client<->server interaction. In your code: searchField = new TextField(); searchField.setImmediate(true); searchField.addTextChangeListener(new TextChangeListener() { public void textChange(TextChangeEvent event) { myImage.removeStyleName(CSS_STYLE_IMAGE_TO_HIDE) // some code myImage.addStyleName(CSS_STYLE_IMAGE_TO_HIDE) } }); The textChange(...) event code is triggered from client side. It is then executed on serverside, until the end of the...

How do you change the background color of a TextField without changing the border in javafx?

java,javafx,javafx-2,textfield,background-color

I found that you can construct a string of css code out of a string and a variable by using the to string method and the substring method like this: colorBox0 .setStyle("-fx-control-inner-background: #"+value0.toString().substring(2)); ...

Change the width of a character to match the size of a TextField

actionscript-3,text,fonts,textfield,text-formatting

I don't think it's possible to scale font on a single axis. The only thing i could think of is to bake the text field and scale the resulting bitmap: var tf:TextField = new TextField(); tf.text = "bitmap text"; var myBitmapData:BitmapData = new BitmapData(80, 20); myBitmapData.draw(tf); var bmp:Bitmap = new...

Bind JavaFX TextField to a String value from two SimpleStringValues

java,user-interface,javafx,textfield,java-8

Can't really see why you would ever make everything in the Data class static, however: public class Data { static StringProperty name = new SimpleStringProperty(); static StringProperty domain = new SimpleStringProperty(); static StringProperty FQDN = new SimpleStringProperty(); static { FQDN.bind(Bindings.format("%[email protected]%s", name, domain)); } public static String setName(String string) { name.set(string);...

replace text in textField with object name - Pymel

python-2.7,textfield,maya,pymel

GUI objects can always be edited -- including changing their commands -- as long as you store their names. So your mainWindow() could return the name(s) of gui controls you wanted to edit again and a second function could use those names to change the looks or behaviors of the...

haxe, openfl: draw textfield on bitmap in a loop

mobile,bitmap,textfield,haxe,openfl

You only add one of your images (addChild(images[1]);) to view. Also, I'd recommend, you to : Find the exact problem with displaying it as a single TextField, start with the exact amount of text needed for it to break. Check if there are some weird Unicode characters in your text,...

pre-populate wtforms text field with values

python,flask,textfield,wtforms

Define your form as such in forms.py from flask.ext.wtf import Form class OrganizationForm(Form): organization = TextField('Organization name:') In your views.py, you import the form and populate it with the nameoforganization from .forms import OrganizationForm nameoforganization = session.get('name') form = OrganizationForm(obj=nameoforganization) or orgForm=OrganizationForm() orgForm.organization.data = nameoforganization Disclaimer: I didnt test the...

How to output math from a text field? Xcode 6 [closed]

xcode,math,field,textfield,calculator

Have a look at NSExpression which lets you do things such as: NSExpression *expression = [NSExpression expressionWithFormat:@"4 + 5 - 2*3"]; id value = [expression expressionValueWithObject:nil context:nil]; // => 3 References NSExpression Class Reference NSExpression on NSHipster ...

JTextField not read the Input by user

java,swing,textfield

The reason you do not get the user input is because of this code: if(PortisInteger(new JFrame().getPortTextField())) { You are creating a new JFrame instance every time the above code is executed. This refers to a different instance of the JFrame and not the one which has the JTextField that contains...

Cannot see the whole information from my database in a text field if i have a space in my text

php,mysql,forms,textfield,space

value=<?=$name?> If the name has a space, the resulting HTML will be: value=Foo Bar Which means the value is only Foo, "Bar" becomes an unrelated second attribute. You need to take care to produce proper HTML syntax: value="<?php echo htmlspecialchars($name); ?>" Also read The Great Escapism (Or: What You Need...

applyCss doesn't work when remove a styleClass

css,javafx,textfield,javafx-8

One common cause of these bugs is that you may have added the "invalid-field" style class more than once. (Remember, getStyleClass() returns a List<String>, not a Set<String>.) So you should probably take steps to make sure the style class is only added once, or take steps to remove all occurrences...

Function not running when return pressed

ios,swift,keyboard,textfield

You forgot to set the UITextField's delegate to your view controller (self) productTitleLabel.delegate = self - also note that you should name your variables properly to avoid confusion (productTitleTextField instead of a 'Label' suffix) Or, instead of doing it programmatically, you can do it in storyboard by Ctrl-dragging from your...

WWW::Mechanize field methods

perl,mechanize,textfield

$mech -> field($name, $value) field() only lets you set one name at a time. But $mech -> set_fields($name => $value, $name2 => $value2,... $nameN => $valueN) ...set_fields() allows you to set multiple names at the same time. That's not really such a big deal because you could always use the...

Java Game: How to store a name entered in textfield and display in a label upon button press

java,textfield

Your UpdateName() method is creating its own local JButton saveName button and adding ActionListener to it. Problem is that this button is not the same as button you added to your content pane. I am not sure why you even need this method. Simplest solution would be placing code responsible...

How to alter the active text field [as3]

android,actionscript-3,textfield

If you access the focus object, you'll have a reference to your currently active (focused on) object. But in reality, just having a TextField that allows input will open a keyboard view (only on mobile) on touching it. You can also tell Flash not to automatically show the keyboard, if...

JavaFX8 - FXML How to call method with parameters in onAction-tag?

java,textfield,javafx-8,fxml

You could just encapsulate the endEdit(...) method call in a @FXML annotated method that handles the action event. Something like this: public class FXMLController implements Initializable { @FXML protected void handleTextFieldAction(ActionEvent e) { endEdit(false); } private void endEdit(boolean flag) { System.out.println("Flag value: " + flag); // Your implementation here }...

Display TableView from TextField and passing data

uitableview,textfield

It is just simple just in UItextField delegate method create your tableview.But return No ,that will never show keyboard and write your tableview code there. here your have to use user defined delegates. //firstViewController *********************** @interface ViewController ()<UITextFieldDelegate,send> { UITextField *textField; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad];...

QML Dialog with focused textField

dialog,focus,qml,textfield,qt-quick

You don't need the function as it is written. From the docs of Dialog for the function open(): Shows the dialog to the user. It is equivalent to setting visible to true. Given that (it's not the problem) it seems like the focus is continously contended between the dialog and...

How to assign data to a variable on a form? [Ruby on rails]

ruby-on-rails,ruby,forms,variables,textfield

HTML does not have variables. I'm assuming you want to assign the value of a form input to a variable in your controller? That is what the params hash is for. In your controller you could assign the value of a input called field like this myField = params[:thing][:field] You...

Limit the number of characters viewed in textfield in android

java,android,xml,textfield

Write this inside your textView android:ellipsize="end" android:maxLines="1" android:singleLine="true" and if you want to scroll in textView use this android:scrollHorizontally="true" http://developer.android.com/reference/android/widget/TextView.html#attr_android:ellipsize...

Can't type in text fields everywhere

twitter-bootstrap,locking,textfield

One of your javascript plugins is interfering with your input values. If you disable javascript on the page then you can actually type or even right click on the page to inspect elements. My suggestion is disabling your plugins one at a time to see which one is interfering.

JavaFX Resizing TextField with Window

javafx,resize,textfield

You can set the HGROW for the textfield as Priority.ALWAYS. This will enable the TextField to shrink/grow whenever the HBox changes its width. MCVE : import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.TextField; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.stage.Stage; public class Main extends Application { @Override...

Why can't set “defaultTextFormat” directly?

actionscript-3,textfield

When you access/read a TextField's defaultTextFormat property (which is what's happening in the line my_text.defaultTextFormat.size=47;), you end up getting a whole new object returned. Eg, it creates a new TextFormat and returns that. Here is an example to illustrate: var tf:TextFormat = new TextFormat(); textField.defaultTextFormat = tf; trace(tf == textField.defaultTextFormat)...

Assign the value from a text field into an int variable to do some math with other variables and then return it?

ios,xcode,variables,textfield,assign

The opposite of that would be getting converting string to float. You can do it with this init = [_Initial.text floatValue]; ...

Copy Text of a Text Field

android,eclipse,copy,textfield

Honeycomb deprecated android.text.ClipboardManager and introduced android.content.ClipboardManager. You should check whether android.os.Build.VERSION.SDK_INT is at least android.os.Build.VERSION_CODES.HONEYCOMB and therefore use one or the other. if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) { // Old clibpoard android.text.ClipboardManager clipboard = (android.text.ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setText("the text"); } else {...

How to display int values in a textfield?

c#,winforms,textfield

Just convert to int when you save and convert back to string when you set the value, protected void btnUpdate_Click(object sender, EventArgs e) { targetPerson = GetPersonById(Convert.ToInt32(hfId.Value)); targetPerson.Name = txtFName.Text; targetPerson.Age = Convert.ToInt32(txtAge.Text); context.SaveChanges(); } and private void DisplayPersonData(Author p) { txtFName.Text = p.Name; txtAge.Text = p.Age.ToString(); } ...

PHP upload file and text from multiple text fields to mysql

php,mysql,dreamweaver,textfield,filefield

You can add more field like : <input name="randomtext2" type="text" id="randomtext2" /><br/><br/> <input name="randomtext3" type="text" id="randomtext3" /><br/><br/> <input name="randomtext4" type="text" id="randomtext4" /><br/><br/> if(isset($_POST['randomtext2'])){ $text2_here = $_POST['randomtext2']; } if(isset($_POST['randomtext3'])){ $text3_here = $_POST['randomtext3']; } if(isset($_POST['randomtext4'])){ $text4_here = $_POST['randomtext4']; } mysql_query("INSERT INTO...

Text starts from right side of the textfield in extjs

extjs,textfield

Yes. Use fieldStyle property. Ext.create('Ext.form.Panel', { width: 300, bodyPadding: 10, renderTo: Ext.getBody(), items: [{ xtype: 'textfield', name: 'name', fieldStyle:'text-align:right;', fieldLabel: 'Name', allowBlank: false }] }); <script src="http://extjs-public.googlecode.com/svn/tags/extjs-4.2.1/include/ext-all.js"></script> ...

Dynamic Adding of Text Fields JQuery

jquery,html,textfield

Here is a solution of what you can do: Remove the id element from your input as in your case any number of items you add to the form they will have same id where as the id should be unique. Append the textbox to a div instead of the...

how to set loop value to textfield?

java,swing,loops,netbeans,textfield

Try this: Random acak = new Random (); int max = 99; int []hasilRandom = new int[9]; StringBuilder text = new StringBuilder(); for (int i = 0; i <hasilRandom.length; i++){ hasilRandom[i] = acak.nextInt(max); text.append(hasilRandom[i]+", "); } jTextRandom.setText(text.toString()); You just overwrited text in textfield every time...

Resize textField Based On Content

ios,swift,resize,textfield

You have to use an UITextView instead of an UITextField Then, you can use the sizeThatFits method. But first you have to know how high one line will be. You can get that information by using lineHeight: var amountOfLinesToBeShown:CGFloat = 6 var maxHeight:CGFloat = yourTextview.font.lineHeight * amountOfLinesToBeShown After that, just...

adding textfield over movieclip images

textfield,movieclip,visible

You're adding your Text field after the movie clips are being initiated. Think of it as a layer, the text field is at the bottom layer, hence they will not be seen. I would look at the container class The Container class is an abstract base class for components that...

How to find out if a textfield is a TLF or classic one in AS3?

actionscript-3,textfield

Yes. You can use the is keyword to check against class types. So, if you had a classic text field with an instance name of classic, and a TLF text field with an instance name of tlf, you could do the following: classic is TLFTextField; //would be false, because it's...

Are textfields not allowed in arrays in as3?

arrays,actionscript-3,textfield,nullreferenceexception,null-object

Although I called the function that initialization the array, it hadn't completed initialization before the next function was called and the array was accessed, giving me the error. By waiting until later to access the array, I avoided the error.

Somthing like key listener for text field

android,textfield,textedit

TextView dont receive key pressed. You need an EditText to do this. Follow the code below: editText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { //here is your code } @Override public void beforeTextChanged(CharSequence s, int start, int count,int after) { // TODO Auto-generated...

How to get actual textfield when is focused in java

java,focus,mouseevent,textfield

You can use addFocusListener like this JTextField myTextField = new JTextField(); myTextField.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent fe) { myTextField.setForeground(Color.RED); } @Override public void focusLost(FocusEvent fe) { myTextField.setForeground(Color.GREEN); } }); ...

Text field in iOS view controller customising

ios,swift,textfield

in the end i am using sketch to create the text then exporting out as a png and importing to the veiwcontroller uiimageview

JFrame/JPanel refreshing and text fields

java,jframe,jpanel,refresh,textfield

how do I fix it? Use a CardLayout. See the section from the Swing tutorial on How to Use CardLayout for more information and examples....

Android fill up text fields

android,login,sharedpreferences,textfield,oncreate

this.userName = (EditText) findViewById(R.id.login_screen_tf_login); this.password = (EditText) findViewById(R.id.login_screen_tf_password); Here you need to get a root view of a fragment, but inside a code of your PlaceholderFragment class: userName = (EditText) getView().findViewById(R.id.login_screen_tf_login); password = (EditText) getView().findViewById(R.id.login_screen_tf_password); http://developer.android.com/reference/android/app/Fragment.html#getView() Of course we suggest that login_screen_tf_login and login_screen_tf_login...

How to get a numerical value from text field

ios,textfield

Get a string from the uitextfield NSString *myNumberString = myTextField.text; Convert to a value double myValue = [myNumberString doubleValue]; Do your comparison....

JavaFX TextField causes NullPointerException

nullpointerexception,javafx,textfield

Instead of calling equals to check for null, you should use "==" like: if (svar.getText() == null) { Reason you get NPE (NullPointerException) is, since as you say svar.getText() is null, you are trying to call equals on null and a reason for NPE....

Add TextField on Chart

java,swing,text,javafx,textfield

The problem exists because you are trying to add the Text in .chart-plot-background which is a Region. The Region serves right for options like showing the Mouse Lines, it is not exactly where you should be adding the EditableDraggableText. Add the EditableDraggableText in the .chart-content which is a Pane and...

Is it possible to set different colors for different lines in a javafx textField/Area?

java,colors,javafx,textarea,textfield

JavaFX's TextField/TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;"); ...

User Cannot Enter Text, Index Out Of Bounds Exception

java,arraylist,javafx,textfield,indexoutofboundsexception

The failure is in btVerify.setOnAction( (ActionEvent e) -> { if(card1.CardValue() == (int)expInput.get(0) Some lines above you create a new LinkedList so there aren't any values in it. This leads to the exception. Edit: As a reply to some comments. A possible solution could look like: (without further necessary refactorings ;))...

ComboBox with TextField

java,combobox,javafx-8,textfield

ComboBox has a setCellFactory method that allows you to create your own custom ComboBox. Take a look at this example: Custom Cell Factory....

how to have default value for a text field only for new form in rails? iam using :value => “0”.but in edit form also iam getting '0' value

ruby-on-rails,forms,default,textfield,value

This should work: <%= f.text_field :duration , :size=>"4", :value => (f.object.duration || 0) %> ...

Hitting Return to save Text Input

xcode,swift,keyboard,save,textfield

Set the view controller as a text field delegate and add the appropriate delegate method. class viewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var textField: UITextField! var savedText: String! func textFieldShouldReturn(textField: UITextField) -> Bool { savedText = textField.text textField.resignFirstResponder() return false } } ...

How to have one input field , two buttons and two actions using same input value in HTML

javascript,html,input,textfield

I've typically put both buttons on the form and used jQuery to attach On Click events to change the action of the form. Try this ... <form id="formAddUser" name="search" method="post" action="/maps"> <input id="inputUserName" type="text" placeholder="Pilgrim ID here..." name="pilgrimID" autocomplete="off"> <br> <br> <button id="btnSubmit1" class="btn btn-info primary" type="submit">Locate Pilgrim</button> <button id="btnSubmit2"...

Section Names In Table Views

swift,tableview,textfield,sections

You can use titleForHeaderInSection. func tableView(tableView: UITableView!, titleForHeaderInSection section: Int) -> String!{ if (section == 0){ return textfield.text } if (section == 1){ return textfield2.text } } ...

how to detect the shift-button/clean input in javascript textfield?

javascript,validation,input,textfield

From your comment: basically this is a "machine" that transforms the input text into a colorful image. so each letter has a image that it is represented by. I want that the user while writing already sees how it looks like. I am on each keyup reading the data of...

In ExtJS 5: How to remove border of textfield

extjs,border,textfield,extjs5

Try with displayfiled in place of textfiled for reference go through the link. http://www.objis.com/formationextjs/lib/extjs-4.0.0/docs/api/Ext.form.field.Display.html

extract string from a json object

json,extjs,textfield,jsonobject

The scope within your select function no longer contains datajson. To continue to use this.datajson you can pass the required scope into the function using bind Ext.application({ name: 'Fiddle', datajson: { 'name': 'Hello' }, displayName: function (combo, record, index) { Ext.getCmp('name').setValue((this.datajson.name)); }, launch: function () { Ext.create('Ext.form.Panel', { title: 'Contact...

How make own style of UITextField without coding of each widget

ios,xcode,textfield

Here you go: class MySuperDuperTextField: UITextField { override func awakeFromNib() { // if you're not using Storyboards, you should override initWithFrame: or come up with your own init // stylize here... layer.borderColor = .redColor().CGColor // red border } } There are lots of approaches to shadows, it's better if you...

how check box check and unchecked automatically

javascript,jquery,cordova,checkbox,textfield

Try using input event $(function() { var chk = $('#checkbox'); $('#textfield').on('input', function() { //fire as user types/drag-drop/copy-paste //replace all white-space and get the actual text length //if lenght is greater than 0, mark it else un-mark chk.prop('checked', this.value.replace(/\s/g, '').length); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table style="width:100%"> <tr> <td> <input type="checkbox" name="favcolor"...

set value textfield from another viewcontroller

ios,swift,textfield

Here's how you do it in 12 easy steps: 1) Yes. I recommend using a Navigation Controller. Start a new project with a Single View Application. 2) Select the ViewController in the Storyboard and from the Menu bar above select Editor->Embed In->Navigation Controller. 3) Drag out a UIButton and a...

Validation of text fields and contact no text field

java,swing,validation,textfield

Can anyone help me about enabling the button after validating all the text fields? Here is a general purpose class that will enable/disable a button as text is added/removed from a group of text fields. It adds a DocumentListener to the Documenent of each text field. The button will...

TextField formatting (padding) issue in Titanium Android

android,formatting,textfield,titanium-mobile,titanium-android

Finally, I solved it using custom theme named mytheme.xml added under platform folder--> android folder --> res folder--> values folder --> mytheme.xml In mytheme.xml : <?xml version="1.0" encoding="utf-8"?> <resources> <!-- Define a theme using the AppCompat.Light theme as a base theme --> <style name="Theme.MyTheme" parent="@style/Theme.Titanium"> <!-- For Titanium SDK 3.2.x...

How to access values from textfield in javascript

javascript,ruby-on-rails-4,textfield,nested-loops

$('.text2').each(function(){ $(this).val(); }) User this jQuery function to get each value of the input in your form. This will only work if all your inputs have the class "text2"....