This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Keyboard layout problem  RSS feed

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working out the gui for an on-screen keyboard to go with my handwriting recognition app for Linux. The keyboard is for primary text entry and correcting mis-recognitions.

Looking at most keyboards, I see some keys span the equivalent of 2 or 3 of the smallest ones. I'm trying to get that effect using GridBagLayout. I'd be happy to hear of another way as well.

I'm specifying the grid position of each key, and also it's weight, expecting that equal weights will provide equal widths, but the width of the characters on the keyface seems to be interfering - using a proportional font, the 'k' and ';' keys have a different width. Similarly, the 'BS' and 'Del' keys have differing widths regardless of the font.

How can I specify that I want an individual key to span 1x, 2x, 3x columns regardless of what's on the button face and always have x turn out to be the same width for all keys, even when the overall keyboard gets re-sized?

Thanks in advance,
Bret

A code snippet to show what I'm doing (it's just the first row of a 'fitaly' layout - not 'qwerty'). A 'standard' key spans 2 columns, and there are keys spanning 3 and 4 columns:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!