textinput

Text input fields in Swing stop working on OS X when holding keys down

本小妞迷上赌 提交于 2019-12-02 04:16:49
I discovered a strange problem with Swing text input fields on OS X Yosemite (using Oracle JDK 8). When I hold down any letter or number key while a text input field has the focus, I can afterwards no longer enter anything in any field of the current JFrame. I then have to close the frame and reopen it to be able again to enter text. The default behaviour in OS X is to bring up a small menu to choose special letters from when holding down a key for a longer time. I guess that the Swing inputs do have a problem with that. Did anyone else also notice this, and is there a solution to this problem

Set the width property for textinput

妖精的绣舞 提交于 2019-12-02 04:10:43
I have created a widget in the same fashion as the showcase application. However I do not see anything in the api documentation to limit the width of the input field. How can I set the width? CTextInput: size_hint_y: None height: '32dp' multiline: False hint_text: 'SNMP Community String(s)' By width I'm assuming you mean text length, as setting the width of a widget is just as easy as setting the height is. There is an example of text filtering in the documentation you linked which could easily be modified to limit the length: class MyTextInput(TextInput): def insert_text(self, substring, from

How can I prevent letters inside a text element?

痴心易碎 提交于 2019-12-01 23:28:46
I like to have an input with maximum length 3. These input value should be only numbers no letters. By referring to this post: why is <input type="number" maxlength="3"> not working in Safari? you can see that I can't use <input type="numbers"> So how can I prevent letters inside an text-input-element? You can use jQuery. $("#myField").keyup(function() { $("#myField").val(this.value.match(/[0-9]*/)); }); <script> function checkPattern(elem) { if(!elem.value.match('^' + elem.getAttribute('pattern') + '$')) { alert('The value must be 3 digits.'); } } </script> <input maxlength=3 pattern=[0-9]{3}

returnKeyType = “next” issue in react native

江枫思渺然 提交于 2019-12-01 23:03:33
问题 I am using returnKeyType = "next" in TextInput component, but it is working like returnKeyType="go" instead of moving to the next textinput field. How can we move from one textinput field to next textinput field using the "next" button on the keyboard? 回答1: You need to set focus on the next textfield using the reference like this: <View style={{flex:1}}> <TextInput style={{height:40}} placeholder="First TextField Input" placeholderTextColor="#DCDCDC" returnKeyType="next" onSubmitEditing={()=

R shiny: How to build dynamic UI (text input)

佐手、 提交于 2019-12-01 20:14:45
问题 I'm trying to build dynamic textInput with R shiny. The user should write in a text field then push an add button to fill another field. However, each time I push the button all the fields become empty, It's like if I must define how many fields I want in advance. Any help will be very appreciated. Thank you Here is my code: library(shiny) shiny::runApp(list( ui = pageWithSidebar( headerPanel("test"), sidebarPanel( helpText("Alternatives list"), verbatimTextOutput("summary") ), mainPanel(

R shiny: How to build dynamic UI (text input)

心已入冬 提交于 2019-12-01 17:52:55
I'm trying to build dynamic textInput with R shiny. The user should write in a text field then push an add button to fill another field. However, each time I push the button all the fields become empty, It's like if I must define how many fields I want in advance. Any help will be very appreciated. Thank you Here is my code: library(shiny) shiny::runApp(list( ui = pageWithSidebar( headerPanel("test"), sidebarPanel( helpText("Alternatives list"), verbatimTextOutput("summary") ), mainPanel( actionButton("obs","add"), htmlOutput("selectInputs") ) ) , server = function(input,output){ observe({ if

unobtrusive “default” text in input WITHOUT jQuery

允我心安 提交于 2019-12-01 14:38:51
i'm trying to write unobtrusive default/placeholder text in input (actually, relatively placed label over input , which hides on onFocus , and stays hidden if input isn't empty on onBlur ), but I don't want to use jQuery, because this is the only javascript used on page - therefore using jQuery seems a bit over the top. Please, how can I do this without jQuery? Thank you. EDIT: I know the idea ( getElementByID ), but I'm more looking into how to add it to document - preferably something you have used before. Thank you. EDIT: Thank you all, I finally went with jQuery, seeing answers :] (my

Get value of <input type=“number”> with JS when it contains non-numeric characters

泪湿孤枕 提交于 2019-12-01 14:32:50
问题 This jsfiddle demonstrates the following issue. The simplest example is: <input id="number" type="number" value="1"> console.log(document.getElementById('number').value); This logs 1 as expected. THIS however: <input id="number" type="number" value="1A"> console.log(document.getElementById('number').value); Just logs an empty string '', because of the non-numeric character in the value. Some devices+browsers (e.g. Chrome) allow you to enter non-numeric characters in these inputs. This is

How to read input from the keyboard in Objective-C

戏子无情 提交于 2019-12-01 10:32:59
Hi I am making a program that gets input from the keyboard and I was wondering if there was any way to get input from the keyboard and store it in an NSString object. If you are doing this as a command-line app, then here's code I wrote last week to get a line from the command prompt (I made it an NSString category): + (NSString *) stringFromStandardInDelimitedByCharactersInSet:(NSCharacterSet *)delimiters { NSMutableString * string = [NSMutableString string]; unichar input = '\0'; while (input = getchar()) { if ([delimiters characterIsMember:input]) { break; } [string appendFormat:@"%C",

How to read input from the keyboard in Objective-C

老子叫甜甜 提交于 2019-12-01 08:50:36
问题 Hi I am making a program that gets input from the keyboard and I was wondering if there was any way to get input from the keyboard and store it in an NSString object. 回答1: If you are doing this as a command-line app, then here's code I wrote last week to get a line from the command prompt (I made it an NSString category): + (NSString *) stringFromStandardInDelimitedByCharactersInSet:(NSCharacterSet *)delimiters { NSMutableString * string = [NSMutableString string]; unichar input = '\0'; while