Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-24-2004, 10:22 AM   #1 (permalink)
freesoft_2000
Code Monkey
 
Join Date: Oct 2004
Posts: 51
freesoft_2000 is on a distinguished road
Question Documents

Hi everyone,

I am currently trying to do a java package software that i will release as open-source. The software basically deals with clipboard operations. Basically what this software package does is to retrieve any kind of data be it an image or a jcomponent or formatted text and insert it into the jtextpane(or text component)
or vice-versa.

What i basically did was to build my own implementation of the windows clipboard and i have it about 80% working except for the last part.

I need a simple example on how to combine documents.
This was what i did but it did not work.
This is source snippet of the part i did to combine the two documents together.

public Document documentpaste ()
{
//All the variables have been declared somewhere above

try
{
File file3 = new File("C:/Final_Clip.dat");
FileOutputStream fStream = new FileOutputStream(file3, true);
ObjectOutput stream = new ObjectOutputStream(fStream);
stream.writeObject(Doc6);
stream.flush();
stream.close();
fStream.close();
}

catch (Exception e)
{

}

try
{
File file3 = new File("C:/Final_Clip.dat");
FileOutputStream fStream = new FileOutputStream(file3, true);
ObjectOutput stream = new ObjectOutputStream(fStream);
stream.writeObject(Doc7);
stream.flush();
stream.close();
fStream.close();
}

catch (Exception e)
{

}

try
{
File file3 = new File("C:/Final_Clip.dat");
FileInputStream fStream = new FileInputStream(file3);
ObjectInput stream = new ObjectInputStream(fStream);
Object obj = stream.readObject();
if(obj instanceof Document)
{
Doc8 = ((Document) obj);
}
stream.close();
fStream.close();
}

catch (Exception e)
{

}

return Doc8;

}

}

I hope you understand the code. What i heard is that i have to get the content of the document using element spec or something and combine them but i am really not sure how to do this part.

What i need is for someone to show me a example of combining the two documents together as a single document.

I hope i didn't bore anyone with this question of mine and wish that someone can help me with this problem.

My e-mail is freesoft_2000@yahoo.com

Thank You

Your Sincerely

Richard West
freesoft_2000 is offline   Reply With Quote
Old 10-24-2004, 11:22 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,173
Belisarius is on a distinguished road
Sorry, I'd love to help but Swing really isn't my area of expertise.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:37 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting