• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

KeyListener with Filter  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone ^^

i am programming a game, and i wanted to make an LoggIn window where you can put in email username password etc. in. The Problem is that a JTextField doesnt work, so i need to programm the textfield for myself. Everyone works at all but it is just taking the Uppcase of the letters A, Z, S a.e. But i want to have lower and upper case letters. Also if you press Backslash, it writes Backslash in the String. Would be cool if you can help me Sry for my bad English at all im from Germany ^^



Here is where the KeyListener for the Textfield is in. The rest of the Class is just Graphic things, but if you need it too :



That is the full code of this class. I am using a GameStateManager so this is just the GameState for managing the screen which is shown when you start the game.

Thanks for your help ^^
 
Rancher
Posts: 1170
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand your question, what is it exact you need? Also please use codetags to post you code in,
without them it makes everything verry hard to read, especially for big blocks like yours
 
Marshal
Posts: 64494
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Demesmaecker wrote:. . . Also please use codetags to post you code in, . . .

He did use code tags, just not right (see here), which I have corrected. But there are still too many blank lines, and many of the lines are too long for use to read the whole of. All those empty lines don't enhance legibility.
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use this part:

to create a switch an put it in a function, since you're using it twice in your code
 
What's brown and sticky? ... a stick. Or a tiny ad.
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!