Click here to Skip to main content
15,888,816 members
Home / Discussions / Java
   

Java

 
GeneralRe: Putting a split String in a printout. Pin
chdboy23-Oct-13 23:16
chdboy23-Oct-13 23:16 
GeneralRe: Putting a split String in a printout. Pin
Richard MacCutchan23-Oct-13 23:23
mveRichard MacCutchan23-Oct-13 23:23 
GeneralRe: Putting a split String in a printout. Pin
chdboy24-Oct-13 0:53
chdboy24-Oct-13 0:53 
Questionapplets Pin
Member 1035631323-Oct-13 18:28
Member 1035631323-Oct-13 18:28 
AnswerRe: applets Pin
Richard MacCutchan23-Oct-13 21:28
mveRichard MacCutchan23-Oct-13 21:28 
QuestionRe: applets Pin
Member 1035631324-Oct-13 16:30
Member 1035631324-Oct-13 16:30 
AnswerRe: applets Pin
Richard MacCutchan24-Oct-13 21:15
mveRichard MacCutchan24-Oct-13 21:15 
SuggestionRe: applets Pin
Member 1035631324-Oct-13 22:01
Member 1035631324-Oct-13 22:01 
<pre>
if(source.getSourceType() == Source.SERIALIZATION)
return deserializeEditor(source.getSerializedObject());



public JTextComponent deserializeEditor(InputStream inputStream)
{
JTextPane p;
System.out.println("deserialize existing document...");
p = new JTextPane();
p.setPreferredSize(new Dimension(labelDimension.getWidth(), labelDimension.getHeight()));
javax.swing.text.EditorKit kit = createEditorKit();
p.setEditorKit(kit);
ObjectInputStream ois = null;
try
{
ois = new ObjectInputStream(inputStream);
Object obj = null;
if((obj = ois.readObject()) != null && (obj instanceof Document))
{
Document doc = (Document)obj;
p.setDocument(doc);
System.out.println("set deserialized document");
}
}
catch(IOException e)
{
System.err.println(e.getMessage());
e.printStackTrace();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
finally
{
safeClose(ois);
}
p.setDragEnabled(!hiddenMode);
return p;
}



public JTextComponent createEditorFromPage(Page page)
{
JTextPane p = new JTextPane();
Dimension dim = new Dimension(labelDimension.getWidth(), labelDimension.getHeight());
p.setPreferredSize(dim);
p.setMaximumSize(dim);
p.setSize(dim);
HTMLEditorKit kit = createEditorKit();
p.setEditorKit(kit);
p.setTransferHandler(new PlainTextTransferHandler());
if(page != null)
try
{
page.setPage(p);
}
catch(IOException e)
{
System.err.println("Attempted to read a bad URL: " + e.getMessage());
}
else
System.out.println("create empty label");
javax.swing.text.Style style = p.addStyle("24pts", null);
StyleConstants.setFontSize(style, 24);
style = p.addStyle("12pts", null);
StyleConstants.setFontSize(style, 12);
style = p.addStyle("Italics", null);
StyleConstants.setItalic(style, true);
style = p.addStyle("Bold", null);
StyleConstants.setBold(style, true);
p.addMouseListener(new PopupMenuMouseListener(new PopupMenuFactory((HTMLDocument)p.getDocument()), p));
p.setDragEnabled(!hiddenMode);
initializeDocument((HTMLDocument)p.getDocument(), p, kit);
return p;
}


</pre>

Save event is there if they click save event whole HTML image is going to save in BLOB object. In there I'm checking if its already save value or new value if its saved value it call deserializeEditor () in this method binary value is converting to string then it will show in editor if its new string value means just it will call createEditorFromPage() event which i showed in above code.

My problem is when they entering text in editor if its reach maximum characters or maximum lines it should open new page.
Its like "Wold document"
sorry while keypress the value I don't no which event is going to fire.please suggest which event is going to fire with any example.

naveenkrishna
QuestionSomething is wrong with the print command. Pin
chdboy21-Oct-13 3:31
chdboy21-Oct-13 3:31 
AnswerRe: Something is wrong with the print command. Pin
angrybobcat21-Oct-13 23:01
angrybobcat21-Oct-13 23:01 
GeneralRe: Something is wrong with the print command. Pin
chdboy21-Oct-13 23:37
chdboy21-Oct-13 23:37 
SuggestionRe: Something is wrong with the print command. Pin
Richard MacCutchan21-Oct-13 23:50
mveRichard MacCutchan21-Oct-13 23:50 
GeneralRe: Something is wrong with the print command. Pin
chdboy22-Oct-13 23:33
chdboy22-Oct-13 23:33 
GeneralRe: Something is wrong with the print command. Pin
Richard MacCutchan23-Oct-13 3:19
mveRichard MacCutchan23-Oct-13 3:19 
GeneralRe: Something is wrong with the print command. Pin
chdboy23-Oct-13 3:54
chdboy23-Oct-13 3:54 
Questionreplace Pin
Member 1030999420-Oct-13 2:21
Member 1030999420-Oct-13 2:21 
AnswerRe: replace Pin
Richard MacCutchan20-Oct-13 6:53
mveRichard MacCutchan20-Oct-13 6:53 
QuestionQuestion about java Pin
Araphat18-Oct-13 22:37
Araphat18-Oct-13 22:37 
AnswerRe: Question about java Pin
thatraja19-Oct-13 1:54
professionalthatraja19-Oct-13 1:54 
GeneralRe: Question about java Pin
Araphat21-Oct-13 3:55
Araphat21-Oct-13 3:55 
QuestionMalformedInputException in RandomAccessFile io Pin
Amer Rehman18-Oct-13 2:49
Amer Rehman18-Oct-13 2:49 
SuggestionRe: MalformedInputException in RandomAccessFile io Pin
Richard MacCutchan18-Oct-13 7:02
mveRichard MacCutchan18-Oct-13 7:02 
GeneralRe: MalformedInputException in RandomAccessFile io Pin
Amer Rehman19-Oct-13 9:14
Amer Rehman19-Oct-13 9:14 
QuestionAdd KeyListener to tabbedPane(Tab) Pin
chdboy17-Oct-13 21:44
chdboy17-Oct-13 21:44 
QuestionRe: Add KeyListener to tabbedPane(Tab) Pin
Richard MacCutchan18-Oct-13 0:48
mveRichard MacCutchan18-Oct-13 0:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.