Question: How to create a Java Runtime Editor

Ads

 
 
 

Share on Google+Share on Google+

rajesh
How to create a Java Runtime Editor
2 Answer(s)      7 years ago
Posted in : Swing AWT
Ads
View Answers

November 10, 2009 at 10:59 AM


Hi Friend,

If you want to generate an editor using java swing, try the following code:

import java.awt.BorderLayout;
import java.awt.Container;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class CreateEditor {
public static void main(String args[]) {
JFrame f = new JFrame("Editor");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = f.getContentPane();
JEditorPane editor = new JEditorPane();
editor.setEditable(true);
JScrollPane scrollPane = new JScrollPane(editor);
content.add(scrollPane, BorderLayout.CENTER);
f.setSize(300, 200);
f.setVisible(true);
}
}

Hope that it will be helpful for you.
Thanks
Thanks


November 10, 2009 at 11:07 AM


/*******************************************************************

If you want to generate an editor using java swing, try the following code:

import java.awt.BorderLayout;
import java.awt.Container;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class CreateEditor {
public static void main(String args[]) {
JFrame f = new JFrame("Editor");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = f.getContentPane();
JEditorPane editor = new JEditorPane();
editor.setEditable(true);
JScrollPane scrollPane = new JScrollPane(editor);
content.add(scrollPane, BorderLayout.CENTER);
f.setSize(300, 200);
f.setVisible(true);
}
}

Hope that it will be helpful for you.
Thanks
Thanks

************************************************************************/

Thnx for your reply.

Actually the requirement is like below..

1.An editor in which user can write java code..
I mean java programs and if user will type an object name then respective method names should come up in drop down..
Similar to eclipse / netbeans..
But the editor should have some jar files, those I can use in my swing application .

2. It should also give compilation errors.

Ads









Related Tutorials/Questions & Answers:
How to create a Java Runtime Editor - Swing AWT
How to create a Java Runtime Editor   Hi, I am working on a requirement in which I need to integrate a java runtime editor in swing application... want to generate an editor using java swing, try the following code: import
How to create Runtime time jLabel in java swing ?
How to create Runtime time jLabel in java swing ?   hi sir. my... difficulties in creating jLabel at runtime according to user input. user will itself enter the number of Jlabel that will create on Panel. if user enter-3, ther
Advertisements
java how to create visual swing editor
java how to create visual swing editor   How do I create a visual swing designer in java ?Meaning that I can "draw" a button,a JTextArea from within my designer program . I just need some basics . I've got no idea how to start
How to create runtime drag and drop form builder using asp.net mvc and jquery
How to create runtime drag and drop form builder using asp.net mvc and jquery  My task is related to Runtime drag and drop Form Builder. I have to design a dynamic form builder in which user has permission to drag the control
java runtime error - JDBC
java runtime error  when i m running my program using type1 driver it is showing a runtime error of SQLException of unable to create the connection object.please give the solution
how to create notepad in java
how to create notepad in java  how to create notepad in java
Rich Text Editor in java
Rich Text Editor in java  Hello Sir, Am in a need of working with rich text editor in java. The technologies am using are java with gwt. Am able... to create image from the whole text area which contains, images, text, styles
text editor in java
text editor in java  hi friends, i want to do a mini project in programmers editor with syntax based coloring in java. i have no idea about this project and i dont know the java lang also.from now only i have to learn. please
java runtime error - JDBC
java runtime error  when i m running my program by using jdk1.6.0 then it is giving the error of classunsupported major.minor version 50.0.to remove... version error 49.0.so, please suggest how will i compensate this problem
how to add fields at runtime in j2me
how to add fields at runtime in j2me  How can I add fields at runtime in my form? How can I switch screens and can add fields at runtime? Thanks Dhruv
How to create a class in java
How to create a class in java  I am a beginner in programming and tried to learn how to do programming in Java. Friends please explain how can I create a class in Java
Java Runtime
Java Runtime       In this section, you will learn about Java Runtime Environment (JRE), it also known as Java Runtime. This is a part of Java Development Kit (JDK). It is a set
How to Create Keyboard in JAVA
How to Create Keyboard in JAVA  please help me to create On-Screen Keyboard with java and please give me an another idia to make it ..............iam waiting for your help ,think u so much
How to create charts in Java?
How to create charts in Java?  Is there any example of creating charts and graphs in Java? thanks   Hi, check the tutorial: Chart & Graphs Tutorials in Java Thanks
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...   ...(new BorderLayout()); //Load the pet images and create an array of indexes
How to save file in vi editor?
How to save file in vi editor?  Hi, I am trying to find commands to save the file in the vi editor? Can anyone show me the example and explain me the commands? Thanks   Hi, Here are the details: How to save file
runtime error in java
runtime error in java  What is Run time error in Java?   Run time error is a syntax error that during the execution of a program.It hash... the link, may this will be helpful for you. http://www.roseindia.net/java/java
java runtime exception - JDBC
java runtime exception  while i executing this source code:- import java.sql.*; public class MysqlConnect { public static void main...(); } } } i got an exception that classnotfoundexception . how can i remove
runtime error - Java Beginners
runtime error  I created a sample java source ,compiled it succesfully using command prompt but when i tried to run i got the folowing error " Exception in thread "main" java.lang.UnsupportedClassVersionError" I have set
java runtime error - JDBC
java runtime error  when i m running my jdbc program it is giving the problem as class not found exception.so, please suggest me what may be the solution regarding this.  Hi friend, The problem is of Jar
java runtime error - JDBC
java runtime error  when i am running my jdbc program using thin driver this error is coming at runtime: Exception in thread "main... to this : Thrown when the Java Virtual Machine attempts to read a class file
java runtime error - JDBC
java runtime error  sir when i m running the jsp connectivity program it is giving the error as follows:' java.lang.NullPointerException at jsp_servlet.__resplogin._jspService(__resplogin.java:237
java runtime error
java runtime error  hi friends i am trying to run the fallowing... ch; choice = JOptionPane.showInputDialog(null, "1. Create Employees Table\n"+ "2. Create Products Table\n"+ "0. Exit\n\n"+ "Enter your choice
how to create interfaces in java
how to create interfaces in java  HI, Here is my code public interface validateInfo { public void validate(String empcode, String password); } class updateInfo implements validateInfo { public void update() { //code
how to create reports in swing java?
how to create reports in swing java?  how to create reports in swing java
runtime error - Java Beginners
runtime error  sir run time error is coming again in this code also null pointer Exception at for( File f:contents) import java.io.*; public class RecentDocumentsDelete { public static void main(String[] args) { String
runtime error - Java Beginners
runtime error  import java.io.*; public class RecentDocumentsDelete { public static void main(String[] args) { String currentUser = System.getProperty("user.name"); System.out.println(currentUser
how to color the Eclipse editor background programmatically?
how to color the Eclipse editor background programmatically?  I have to color specific portion(background) of the of the Eclipse editor by running the java programm and provided that do the coloring from a given line number
How to create first program in Java?
How to create first program in Java?  Hi, I am new in Java programming. Tell me How to create first program in Java? Thanks   Hi, Read more at First Java Program. Thanks
java runtime error - Java Beginners
java runtime error  sir, i have installed jdk in my system.i had also set path.But i am unable to run the compiled class file.it shows run time...://www.roseindia.net/java/java-classpath.shtml Thanks
How to create and use Array in Java?
How to create and use Array in Java?  Hi, How to create and use Array in Java? Write program to construct and use the array. Thanks   Hi... can read complete example at Array in Java. Thanks
Tutorials   
Java Spring Hibernate Struts Training Change JPanel background color from mouse entered/exit event JTable Pagination Jcombobox JAVA SWING how can i display a pdf file in a jtextarea Crop Image Code in Applet Crop Image Code in Applet Image Manipulation in Swing AWT Applet Ho to get virtual key code. how to show set of images continously using JScrollpane in java how to show set of images continously using JScrollpane in java How to connect on screen keyboard to system. How to connect on screen keyboard to system. query java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings Download. how to open one Jframe from main method call Urgent requirement display shapes i am getting an error in adding a menu item to a menu. I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this Sliding window protocol how to update the value of jslider how to update the value of jslider how to update the value of jslider how to update the value of jslider how to update the value of jslider Jbutton in JTable cells program code java textfield problem swing retrieve data from database in java swing form using prev n next buttons retrieve data from database in java swing form using prev n next buttons How to close a frame on action event of a button from a different class ? searching the data swings for webnms Jpanel allignment pass data from java frame to file code for traffic control system simulation Bank Management System how to maKE Jcombox editable after saveing value init. i havei) aJTextField and one button. when place the cursor or enter anything in the test field then only button should be enabled.by default the button should be disabled. i havei) a jtable with few cloumns and few rows andii) one button. when place the cursor in any of the table's column cell. i need to enable the button.by default the button should be disabled. PDF Comparator i have JTextfield and JComboBox. there are several values in combobox.when i select a value from combobox how to make textfiled as a combobox. issue on jcombobox

Ads

 
Advertisement null

Ads