JSF :: WYSIWYG Editor In ModalPanel
Mar 25, 2015
I've tried a few different editors, like CKEditor and TinyMCE, but I seem to run into the same problem with every one. The text area seems to be disabled in a modalPanel. Everything looks like it displays properly, but the blinking cursor doesn't show up and you can't enter any text. Below is an example of the a4j:form that I use in the modalPanel with TinyMCE. why I wouldn't be able to enter any text into the editor? Is there a different editor that will work better?
<a4j:form id="commentpanelform">
<htm:table border="0" id="woverify" width="500px">
<htm:tr><htm:td height="20px" valign="top" colspan="2">
<rich:messages styleClass="errorMessage" style="text-align:center;"/>
</htm:td></htm:tr>
[code]....
View Replies
ADVERTISEMENT
Jun 11, 2014
Here is the original code I found on StackOverFlow. It highlights some specific words in a JTextPane.
import javax.swing.*;
import java.awt.*;
import javax.swing.text.*;
public class ColorChangeWhileTyping extends JFrame{
private int findLastNonWordChar (String text, int index) {
while (--index >= 0) {
if (String.valueOf(text.charAt(index)).matches("W")) {
[code]....
I dont know for some reason it doesnt work correctly. The colour goes away after I press Space to write the next word.
View Replies
View Related
Jul 29, 2014
Not a Java editor with a GUI, but and editor for editing Java GUI's (Graphically (With JFrame, Swing etc) (Kinda like FrontPage for HTML only for Java/Linux. You just add stuff / drag objects around and then optionally review the code after..
View Replies
View Related
Jul 17, 2014
For some reason when I try to run the program it gives me an "editor does not contain a main type" launch error.
/*
* A program that plays and scores a round of the game Poker Dice. In this game, five dice are rolled. The player is allowed to select a number of those five dice to re-roll. The dice are re-rolled and then scored as if they were a poker hand. The following hands MUST be scored in this assignment:
* * High card
* * One Pair
* * Two Pair
* * Three of a Kind
* * Full House
* * Four of a Kind
* * Five of a Kind
* For extra credit, you may also implement:
* * Straight
*/
import java.util.Scanner;
public class Project10 {
public static void main(String[] args) {
Scanner inScanner = new Scanner(System.in);
int[] dice = new int[5];
resetDice(dice);
System.out.print("Your current dice: + dice");
[code]....
View Replies
View Related
Nov 17, 2014
I am working on a game engine with java. I have come to the final stages of the development of this engine now and need a small hand. For this i am using java's built in libary for graphics. and am strugling to create a nice looking GUi with it, What i need:
The class extends the canvas class and adds it to the jframe, i have set the window up as standard and added a menubar, and net the canvas, what I want to do.
For those of you that have used application such as tiled (shown here [URL] .....) what i am wanting to do is create a gui around the canvas similar to this where the parts on the right are resizable up and down and in and out. i was wondering how i would go about incorporating this.
View Replies
View Related
Jun 27, 2014
I am starting a project of a little game for my brother and I wanted to know whether a few things were possible using Java (I know the basics and am currently learning more, but I have about a year to complete this so I have time to learn what is needed).What I need to be able to do:Be able to view a PDF as well as zoom in and pan around itBe able to enter/edit text in said PDF fileBe able to hide some of the text in this PDFBe able to do this on several PDFs in one program (They won't be open at the same time)
Is it possible to do this in Java? If so, how? (As in, what things would I need to learn or what would I need to complete it)If it makes my question easier, what it will be is a London Underground Tube Map (Which is a PDF file)where some station names disappear and the player has to guess which station(s) are missing.
View Replies
View Related
Mar 19, 2014
I'm want to write a program to design single page documents. It needs the following features.Drag text and place it anywhere on the page, ideal I would like to add a 'snap to grid' optionDraw boxsAdd simple images (logos)
I plan to do it using Swing, but I've not done anything with this since finishing Uni. how to structure this and what swing components will be best suited for this task?
View Replies
View Related
Jun 23, 2014
I'm having a problem with a small text editor I'm trying to create. I have implemented a panel of labels, containing line numbers, on the left of a scrollable text area. The panel is designed to size such that it fits the larger numbers whenever they appear. It does that very well, actually, until either one of the scrollbars appear. As soon as one does appear, it immediately shrinks in width. The horizontal scrollbar even blocks the view a little, making it impossible to see what you are writing on the very last line.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Main implements KeyListener {
public static JPanel tab = new JPanel(false);
public static JTextArea text = new JTextArea();
public static JScrollPane scroll, reflex;
public static JPanel lines;
[code]...
Explanation of the code: There is a main panel which embodies a text area and another container filled with labels of line numbers.Both the text area and line number panel have scroll panels attached. They are synchronized, in order to scroll at the same time.
The main class contains a static function "position" which generates a GridBagConstraints, created for the convenience of single-line creation of constraints.It also implements the KeyListener interface, and waits for change in the amount of lines inside the text area. Afterwards, it changes the panel of labels accordingly.
View Replies
View Related
Mar 18, 2015
I am trying to set the font of the editor as the same for the renderer of JTable. I am just a bit confused on how to do this. I don't want any code but maybe a walkthrough on what to do. Here is my abstract table model ....
public class ProductTableModel extends AbstractTableModel {
private ArrayList <Product> prodList = new ArrayList <Product> ();
private String [] columnNames = {"ID", "Description", "Inventory", "Cost", "Order Quantity"};
public ProductTableModel (ArrayList <Product> productList) {
this.prodList = productList;
[Code] .....
View Replies
View Related
Apr 2, 2015
I want to create a jsp where there is a textbox and the user can change font styles (such as bold, italicized, underline, change color, change font style, highlight align a word/s) inside the textbox just like an MS Word. I'm not looking for a system similar to code ranch's posting of message which displays the tag in a textbox...
View Replies
View Related
Jun 16, 2014
I'm using [URL] ....., I'm quite surprise of the fact that there isn't a property for the text value. So you can't bind this component to the model.
Why in our opinion there isn't a property to bind (as in other components)?
View Replies
View Related
Apr 13, 2014
I'm trying to program a tile-based map editor and most of it is going quite smoothly except trying to organize the layout. Originally I was going to use 2 frames, one for the map, and 1 for the tile set, but after reading about frames I learned that that is bad practice and is also inconvenient because there is no way to have both frames in focus at once (so you need to click an extra time to gain focus when switching windows). So what I'd like to do is create a single frame application that holds 3 panels. One for the map, one for the tile set, and one for tile settings. This is basically what it would look like:
Note that the tile settings panel uses GUI elements (a border, a JLabel (which starts out empty), a JComboBox, and a JTextField) while the other 2 panels are just drawing panels*
Now I have tried multiple things which either did not work visually (panels were inside panels) or did not compile. One thing I tried was using BoxLayout to put the 2 tile panels vertically within a temporary panel which I then tried to add into the frame after the map panel (with FlowLayout), but that made it look like this: I honestly don't know what else I did that I should write here because in retrospect many of the tings I tried were silly or I don't remember exactly what I did. What would be the best layout to doing what I want?
View Replies
View Related
Sep 25, 2014
How do I escape the characters of a primefaces editor?
I have this in form in a xhtml page
<p:editor value="#{managebeanX.valor}" />
but when I try to save this value through a sparql query it says:
virtuoso.jdbc4.VirtuosoException: SQ074: Line 2: SP030: SPARQL compiler, line 2: syntax error at 'Apple' before '-'
Here is the sparql query
INSERT INTO GRAPH <http://localhost:8890/Asst> {
<http://www.dominio.edu#Q1> rdf:type asst:Question; asst:prompt "adada <span class="Apple-tab-span" style="white-space:pre"></span>"^^xsd:string. }
The Blue text is the value of the p:editor. It' has html characters... So I think I need to scape those characters... but how?
View Replies
View Related
Jul 23, 2014
What I'm trying to do is make an inventory type program that includes a jtable. In the Jtable in the last column there will be 2 buttons and a textfield to register the value of additions or subtractions to the overal stock amount. (See screenshot in attachment).
As of now I am able to increment or decrement the numbers when the buttons are clicked on however the problem is that if I add 2 to the first row, and then go to add 2 to the next row or any other row for that matter, the value of the previous row is added to the next row, and the previous row reverts back to a value of 0. So basically its like there is only one editor that keeps track of one value no matter what row you are editing.
I need getting it so that I can add different values to each different row depending on the stock being used or received. The following is my code:
Main class
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(10, 155, 643, 233);
IMG.add(scrollPane);
center = new centerJustify();
ts = new tableCellRenderer();
tm = new DefaultTableModel(){
[Code] .....
View Replies
View Related
Mar 22, 2014
The program below compiles and functions correctly for the most part. It is supposed to be a simple GUI Text Editor with Edit and Format functions. The content pane is supposed to be a scroll pane, however no matter how much I type into the editor, the scroll bar does not appear. Also, the none of the functions under the "Edit" menu work.
Java Code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
/**
* A simple text editor. It creates and displays the GUI Text Editor.
*/
public class TextEditor extends JFrame implements ActionListener
[Code] .....
View Replies
View Related
Jul 10, 2014
I've come across an interesting problem when using a Jcombobox as a custom cell editor(and renderer) in a jtable. I was hoping to add a keybinding in order to display the dropdown of the combobox instead of having to click on it however, when I make a call to showPopup() I get:
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location Which is strange as my jtable is visible and the editor/renderer seems to be working fine.
Here's the cell editor + renderer I'm using:
class MyComboBoxRenderer extends JComboBox implements TableCellRenderer {
public MyComboBoxRenderer(String[] items) {
super(items);
} public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
if (isSelected) {
setForeground(table.getSelectionForeground());
[code]....
View Replies
View Related
Nov 27, 2014
I am working on a personal project and want to create a text editor to write my code. I am wondering how could I read the last input from the user and if say it was an open curly brace {, then like netbean's my editor will supply the closing curly brace. My java experience is limited but I have tried to read key board input and a few other options that did not work.
View Replies
View Related
May 13, 2015
This is the code that I wrote but I have two problem with two buttons one of them ... I want to delete the selected text inside the text Area which represented as b[8] and the other button that I want to select parts of the texts which represented as b[0]....
Here is the code..
package KOSAR2;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
[Code] .....
View Replies
View Related
May 22, 2014
For my jsp file, the code editor shows no error, but the projects window shows an error. I built my project again, cleaned the project, restart eclipse twice and summoned cthulhu. But my project still shows an error. How do I find the cause.
Eclipse project -
JSP file -
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="mine" uri="DiceFunctions"%>
[Code] ....
View Replies
View Related