• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Focus and Style problems

 
Ranch Hand
Posts: 4716
9
Scala Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have two problems with my new project. let's start with the focus problem. the tutorial i am using as a stating point works the way i want. when you run it the focus is on the JTextPane. mine it is not. i have to click on the JTextPane to give it the focus. also when using the menu, or in my case the toolbar, the focus returns to the JTextPane, but not in mine. again, i have to click on the JTextPane.


the other problem is when changing the Style. the example program works fine. you change the style to bold for instance. from that point on it is bold until you change it. mine works that way too(because i am using an Action). but for the Styles that i can't use a pre-defined Action for(like color which i use an Action listener for), it changes the entire paragraph to that color.

i will try to figure this out on my own, but i am handicapped by a laptop battery that only holds 30 minutes, and a library with limited hours.

here is the entire code for the tutorial and my code. they are both very long...sorry
their code:

my code so far:
 
reply
    Bookmark Topic Watch Topic
  • New Topic