Forums Register Login

Focus and Style problems

1
+Pie Number of slices to send: Send
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:
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1197 times.
Similar Threads
inner classes
need help with StlyedDocument
About Undo!
undoProblem
mousePressProblem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:29:09.