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

need help setting Styles  RSS feed

 
Ranch Hand
Posts: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have had this problem since i first started this project. the code is a lot easier to read now so i hope someone can tell me what i am doing wrong. in my app, the styles that are set by Actions work fine. bold + underline etc. three of the Styles i have to write myself are for the font family, the font size, and the color. i have an action listener for this. the problems with them are two(but they might be related). instead of starting the new style at the caret, my code changes the entire paragraph. second. my styles will mix with the Action ones but not each other. i can have red and underline but not red and font size 72. when i change the font size the color goes back to black. the tutorials don't seem to help me much. here is the code in question.

here is the entire class
 
Rancher
Posts: 2940
19
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in my app, the styles that are set by Actions work fine.



Use the Actions from the editor kit. Create the Action dynamically when an item from the combo box is selected and invoke it manually:



Or you can always look at the source code for the existing Actions to see what you are doing differently.
 
Randall Twede
Ranch Hand
Posts: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Rob

Use the Actions from the editor kit. Create the Action dynamically when an item from the combo box is selected and invoke it manually:


i hadn't thought of that. i will give it a try

Or you can always look at the source code for the existing Actions to see what you are doing differently.


i did think of that but the API source didn't seem to come with my copy of java7EE
i found it seperately and downloaded it, but i forgot where i put it at
 
Randall Twede
Ranch Hand
Posts: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that works just fine. maybe i will try to figure out what was wrong with my code someday, but there is no point in re-inventing the wheel.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!