Results 1 to 8 of 8
Thread: quick swing toolbar question
- 01-10-2012, 05:22 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 39
- Rep Power
- 0
quick swing toolbar question
i'm looking to build a notepad
now i need to do the copy paste and cut in the toolbar
my my question is how do i access the marked text
like if i mark a text inside the text box and i want to make the function work on him
please help with some direction
thanks a lot to all helpers !
- 01-10-2012, 05:28 PM #2
Re: quick swing toolbar question
Have you consulted the API at all? It should be your best friend.
Java Platform SE 6How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 01-10-2012, 06:28 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 39
- Rep Power
- 0
Re: quick swing toolbar question
ok i found the clipboard thing in there should be usefull with the set and get content but the question remains
how do i reffer the button to a marked text in the textbox
- 01-10-2012, 06:44 PM #4
Member
- Join Date
- Jan 2011
- Posts
- 39
- Rep Power
- 0
Re: quick swing toolbar question
.getselectedtext , just found it
am i going the right way with this ?
-
Re: quick swing toolbar question
All Swing text components such as JTextField, JTextArea, JEditorPane and JTextPane ultimately derive from JTextComponent which has cut(), copy(), and paste() methods. I would simply start with those methods first.
- 01-10-2012, 07:14 PM #6
Member
- Join Date
- Jan 2011
- Posts
- 39
- Rep Power
- 0
Re: quick swing toolbar question
hehe yea that pretty much settles it , didn't know that was there , got all complexed
thanks a lot to all
- 01-10-2012, 07:17 PM #7
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Re: quick swing toolbar question
Use the default Actions provided by the editor kits:now i need to do the copy paste and cut in the toolbar
toolBar.add( new JButton( new DefaultEditorKit.CutAction() ) );
See: Text Component Features (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components) for a more complete working example.
- 01-10-2012, 08:56 PM #8
Similar Threads
-
Quick question.
By juxta in forum New To JavaReplies: 11Last Post: 12-09-2011, 03:23 AM -
Quick Question
By mDennis10 in forum New To JavaReplies: 4Last Post: 09-30-2011, 04:48 AM -
Really Quick question
By Ryan10 in forum New To JavaReplies: 63Last Post: 03-02-2011, 02:11 AM -
Swing class 2-column toolbar
By GPB in forum New To JavaReplies: 0Last Post: 04-29-2010, 10:16 AM -
Really quick question
By shadycharacter in forum New To JavaReplies: 2Last Post: 04-22-2010, 10:06 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks