Friday, 21 September 2012

Best HTML editor for Java Swing Application: EKIT

Ekit is a free open source Java HTML editor applet and application. The Ekit standalone also allows for HTML to be loaded and saved, as well as serialized and saved as an RTF. It is approaching its first production release version.
Ekit has proven to be very popular, with hundreds of developers using it in over 30 countries. Many have added to it already, and I always welcome additional contributions. Please feel free to share any enhancements or bug reports with Ekit
Download Ekit
Implementation:
import com.hexidec.ekit.EkitCore;
private EkitCore ekitCore;
Jscrollpanel.add(ekitCore.getToolBarMain(true));
Jscrollpanel.add(ekitCore.getToolBarFormat(true));
Jscrollpanel.add(ekitCore.getToolBarStyles(true));
Jscrollpanel.add(ekitCore);
It’s Simple.

6 comments:

  1. Is that JScrollPanel or JScrollPane from javax.swing package? If it's JScrollPane, is it possible to add four components to a single view port?

    ReplyDelete
    Replies
    1. Hi Moses,

      You can use as below :
      ekitCore.getToolBarMain(true);
      ekitCore.getToolBarFormat(true);
      ekitCore.getToolBarStyles(true);
      Jscrollpane.add(ekitCore);

      Please let me know still have any question.

      Delete
  2. Hi, i cant git work this is my code

    package ekit;

    import com.hexidec.ekit.EkitCore;

    import java.awt.Dimension;

    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.Rectangle;

    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.JToolBar;
    import javax.swing.ScrollPaneConstants;

    import oracle.jdeveloper.layout.XYConstraints;
    import oracle.jdeveloper.layout.XYLayout;


    public class FrameMain extends JFrame {
    private EkitCore ekitCore = new EkitCore(false);
    private JLabel jLabel1 = new JLabel();

    private JPanel jPanel1 = new JPanel();
    private JLabel jLabel2 = new JLabel();
    private XYLayout xYLayout1 = new oracle.jdeveloper.layout.XYLayout();
    private XYLayout xYLayout2 = new oracle.jdeveloper.layout.XYLayout();

    public FrameMain() {
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

    private void jbInit() throws Exception {
    this.getContentPane().setLayout( null );
    this.setSize(new Dimension(767, 619));

    ekitCore.getToolBarMain(true);
    ekitCore.getToolBarFormat(true);
    ekitCore.getToolBarStyles(true);
    ekitCore.setSize(jPanel1.getWidth(), jPanel1.getHeight());
    //jLabel1.setText("jLabel1");
    //jScrollPane1.getViewport().add(jLabel1, null);
    jPanel1.setBounds(new Rectangle(10, 10, 680, 530));

    jPanel1.setLayout(xYLayout2);
    jLabel2.setText("jLabel2");

    jPanel1.add(ekitCore, new XYConstraints(20, 0, 605, 410));
    this.getContentPane().add(jPanel1, null);
    }
    }

    ReplyDelete
  3. how can I get html content from ekit class?

    ReplyDelete
  4. Thank you for your help. Also I found these lines of code within the Erik.jar (decompiled)


    EkitCore ekitCore = new EkitCore();
    //---



    JDialog frame = new JDialog(this, true);
    frame.setJMenuBar(ekitCore.getMenuBar());

    Container content = frame.getContentPane();


    content.setLayout(new GridBagLayout());
    GridBagConstraints localGridBagConstraints = new GridBagConstraints();
    localGridBagConstraints.fill = 2;
    localGridBagConstraints.anchor = 11;
    localGridBagConstraints.gridheight = 1;
    localGridBagConstraints.gridwidth = 1;
    localGridBagConstraints.weightx = 1.0D;
    localGridBagConstraints.weighty = 0.0D;
    localGridBagConstraints.gridx = 1;

    localGridBagConstraints.gridy = 1;
    content.add(ekitCore.getToolBarMain(true), localGridBagConstraints);

    localGridBagConstraints.gridy = 2;
    content.add(ekitCore.getToolBarFormat(true), localGridBagConstraints);

    localGridBagConstraints.gridy = 3;
    content.add(ekitCore.getToolBarStyles(true), localGridBagConstraints);

    localGridBagConstraints.anchor = 15;
    localGridBagConstraints.fill = 1;
    localGridBagConstraints.weighty = 1.0D;
    localGridBagConstraints.gridy = 4;
    content.add(ekitCore, localGridBagConstraints);


    frame.setSize(550, 450);

    frame.setLocationRelativeTo(this);
    frame.setTitle("Template Editor");

    ekitCore.setDocumentText(template_preview.getText());

    frame.setVisible(true);

    //---


    template_preview.setText(ekitCore.getDocumentBody());
    template_save();


    Soley Pasban

    ReplyDelete
  5. Can we use Ekit as JavaFX component?

    ReplyDelete