//不太明白你的意思,不过希望这个小程序can help you.
import java.io.File;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;public class InsertPic extends JFrame {
private JFileChooser chooser = new JFileChooser();
private JTextPane textPane = new JTextPane(); public InsertPic() {

addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
System.exit(0);
}
}); Container contentPane = getContentPane();
JMenuBar menuBar = new JMenuBar();
JMenu insertMenu = new JMenu("Insert");
JMenuItem imageItem = new JMenuItem("image");
JMenuItem chooserItem = new JMenuItem("color chooser"); insertMenu.add(imageItem);
insertMenu.add(chooserItem); menuBar.add(insertMenu);
setJMenuBar(menuBar);
      contentPane.add(textPane, BorderLayout.CENTER); chooserItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JColorChooser chooser = new JColorChooser();
chooser.setMaximumSize(chooser.getPreferredSize());
textPane.insertComponent(chooser);
}
});

imageItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int option = chooser.showDialog(InsertPic.this,"Pick An Image");
            if(option == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
               if(file != null) {
textPane.insertIcon(new ImageIcon(file.getPath()));
} }
}
});
}

public static void main(String args[]) {
 new InsertPic().show();
}
}