Tim frank

Greenhorn
+ Follow
since Mar 07, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tim frank

recently i've made a java program consisting of 4 classes, is there any way I can make this into a file that will run on other machines, something like a C++ .exe file? I've heard about JAR files, but not really too sure what they are.
Can anyone help, I really want to have some way of installing/running my program on other machines?
17 years ago
Recently I have started using the DocumentRenderer class to print informaton inside of a Jeditorpane or Jtextpane as this seems the most common sense approach to doing such a task in less than 500 lines of code.

However, I am trying to print a styleddocument where different font sizes and types are being used. After using the following code



This only prints out the lines of text entered, and NOT the style or size applied to this text.

Does anyone here print out styleddocuments from a JTextPane, or use DocumentRender that would be able to help with this situation.

Many Thanks
17 years ago
Sorry, I'm an idiot. I was looking for the frame decloration in the wrong class... it's working fine now haha. Thanks everyone
17 years ago
I'm using JBuilder Frame designer tool to make this program and in the code it doesnt give have a JFrame construcotr.. anywhere, So i cant change the size that way. I

n the design view the only top level components I can see are the contentPane, Jscrollpane, and Jtoolbar.

Ahh please help, this is frustrating beyond belief.
17 years ago
Hey, I've got a frame the is intended to be at fullscreen size - so who ever uses this program the frame is intended to maximise to meet the size of their screen. However I can't figure out how this is done?

Can anyone shed some light on the matter?

Regards
17 years ago
That did the trick. Thanks a lot!

Now i've just got to figure out how to make the JComboBox editable, as when it is editable the size doesnt seem to change when a value is entered or selected. It's very odd.
17 years ago
I have a Jcombobox filled with numbers ranging from 2 to 20 which are intended to represent the size of the text entered into the JTextPane.

I use the "StyledEditorKit.FontSizeAction" to set the font size of the JTextPane, this font size is taken from what is currently selected in the Jcombobox.

I use the following code to do this

public void jComboBox4_actionPerformed(ActionEvent e) {
int thefontsize= (Integer) jComboBox4.getSelectedItem();
Action sizeAction = new StyledEditorKit.FontSizeAction("Font Size",thefontsize);
jComboBox4.setAction(sizeAction);
}

However when I use this action and select, say 20 from the combo box then text will not change from its original state, however if i select another value from the combobox then the text size will change to 20. this carries on with whatever previous value was selected in the combobox only being applied after selecting another value.

Im confused as to why this is happening. Any help would be appriciated
17 years ago
Anyone? I would appricaite any help greatly
17 years ago
Ok, well I've figured it all out and got it working.. after a lot of time.
Basically everything is now working fine except I have a JcomboBox where the user selectes the size and this changes the text... except If i select the size 20, nothing will happen, then if i select the size 8 the selected text will change to size 20, and the next go the text will change to size 8.

basically the text size selection seems to be stuck one move behind what you actually choose. This is bugging me, could anyone PLEASE shed some light into what might be going on... here is the code I'm using to change the font size

combobox is initiated like this....


then in the action listener I put this...

17 years ago
you mean this tutorial
http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html#textpane
okay thanks, ill have a look.
Basically, I want to have a text area where users enter text and can select what text size and style to apply to each area of this text. Im having trouble finding code examples of this with styleddocuments.
17 years ago
I've had a look around the net using google and the link posted, but I can't seem to find much helpful information on styleddocumnets.

Are there any website or materials that show what a styleddocument is and how they are created/used? As i'm not sure what they are and how to implement one into a Text Pane
17 years ago
Hey guys. I'm using a bit of spare to to make a basic text editior. Basic as in all you can pretty much do is enter font, then change the font style and size.

At the moment it works great, you can have text of different styles and sizes... but it can only be applied to all text in the JTextArea, where I want it to only be applied to highlighted or current text... can this be done?
17 years ago
Where abouts? I can't see it
18 years ago
JSP
You what now?

How would i do that?
18 years ago
JSP