yes, when I have original jars path in classpath (jars are in
OFFICE_HOME/program/classes)
I suppose the classloader used by com.sun.star.loader.Loader needs to be
extended so that its getResource method finds the executable.
Add the OOoBean to the panel as you would do with every other component.
For example:
m_bean = new com.sun.star.comp.beans.OOoBean();
add(m_bean, BorderLayout.CENTER);
pack();
setBounds(x, y, width, height);
setVisible(true);
m_bean.loadFromURL("private:factory/swriter", null);
validate(); //may not be necessary
--Joachim
I try your suggestion, but I have any adding :
after loadFromURL , I have to add aquireSystemWindow().
Panel must be in frame before aquireSystemWindow
This is simple example - it work for SAL_USE_VCLPLUGIN=kde
(I isn't important what I use : kde or gnome - it work only for kde)
I try gtk 2.4.14,2.8.3,2.8.4 without success - frame is open, there isn't
exception or error
but office isn't in frame (I have empty frame - background color is from gnome)
I try with java.awt.Frame instead javax.swing.JFrame - it is same
That's unfortunate. I cannot tell you right now, what's wrong here. This
needs some further investigation.
Thanks,
Joachim
Thanks
Haris Peco
example :
package firststeps;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import javax.swing.JFrame;
import com.sun.star.comp.beans.NoConnectionException;
import com.sun.star.comp.beans.OOoBean;
import com.sun.star.comp.beans.SystemWindowException;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.util.CloseVetoException;
public class OOoBeanExample extends JFrame {
private static final long serialVersionUID = 1L;
private OOoBean m_bean;
public OOoBeanExample(String title) {
super(title);
m_bean = new com.sun.star.comp.beans.OOoBean();
add(m_bean, BorderLayout.CENTER);
setBounds(0, 0, 800, 600);
setVisible(true);
try {
m_bean.loadFromURL("private:factory/swriter", null);
m_bean.aquireSystemWindow(); // doesn't work without this
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (CloseVetoException e) {
e.printStackTrace();
} catch (NoConnectionException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SystemWindowException e) {
e.printStackTrace();
}
validate(); // may not be necessary
}
public void stop () {
setVisible(false);
m_bean.stopOOoConnection();
}
private static void createAndShowGUI() {
final OOoBeanExample frame = new OOoBeanExample("OOoBean example");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
frame.stop();
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]