PDF Viewer / Zoom / Editor?

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


ADVERTISEMENT

Swing/AWT/SWT :: How To Zoom JtextPane

Jan 9, 2014

How to zoom the following jtextpane

package openurdu.page;

import java.awt.Color;
import java.awt.ComponentOrientation;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;

[code]....

View Replies View Related

Base64 Encoded String Of Raw PDF Data - ThinkFree PDF Viewer

Apr 30, 2014

I'm getting a Base64 encoded String of raw PDF data from a web service. I have to use this data display the PDF in a PDF viewer (I happen to be using the included 'ThinkFree PDF Viewer' since I'm working on an Android application, but the Android forum doesn't seem to get much traffic, so lets generalize and say any PDF viewer will do).

My code:

File file;
FileOutputStream outputStream;

public void createFile() {
try {
File path = new File(getFilesDir(), "PDFs");
if (!path.exists()) {
path.mkdirs();

[code]....

The error: Error opening file. It does not exist or cannot be read.

View Replies View Related

Applet Viewer - Show Status Method Not Working

Apr 6, 2014

import javax.swing.*;
import java.awt.*;
import java.net.*;
import java.io.*;
public class App extends JApplet{
public void init(){
showStatus("applet");
}
}

This code does nothing to my statusbar.

I use applet viewer for my applet.

View Replies View Related

Java Applet - Open / Zoom In / Out Of Image

Jul 29, 2014

Working on an assignment for a class: Create a DESKTOP application that allows you to open an image file and enables you to zoom in on or out from an image. I believe all I need is too create an open button to open the actual image file, instead of the html link, this code is an example that the teacher provided.My current code:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.URL;
import java.io.*;
import javax.imageio.*;

[code]....

how to add an open file button so I can search for the file and then open it into my program.

View Replies View Related

JavaFX 2.0 :: JFreeChart - When Zoom In Or Out Repaint Works Not Well

May 8, 2015

I have a problem using JFreeChart with JavaFX. I wrote a small program here . At first the graph likes this:

I use fullScreen function to display the JFreeChart Line Chart Demo 2. Here I use SwingNode, ChartPanel to embedded JFreeChart into JavaFX Panel.(Detail part will be included in code later)

Then I press ESC to exit fullScreen. Then it looks like this:

So far, it's as expected. Then I use mouse drag to enlarge the window. Here comes the problem, as the following picture.
 
Can you see that, seems like appear another graph. And I must click on the window, then everything will become good. I wish the graph shows well even when I drag the window to enlarge, is there something I missed? And here is my code:

package testxychart; 
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

[Code] ....

I think, when I use several graphs in one JavaFX Panel, this will becomes a big problem.

View Replies View Related

Applets :: Label Fonts Of Embedded Applet In HTML Not Same As In Viewer In Eclipse

Jun 22, 2014

I have an applet which I want to embed into HTML. In applet viewer in Eclipse IDE the view is this(see pict01), and when I access my index.php on local server I get this view(see pict02). I don't know what I am doing wrong. I checked it with Firefox, IE and chrome. No changes. Here is source code:

import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.applet.*;
import java.net.URL;
public class WCURL extends JApplet {

//static final int WIDTH = 8;
//static final int HEIGHT = 12;

[Code] ......

I have these files in my local servers folder where I am trying to access it from(see pict03).

View Replies View Related

Japplet Open File - Zoom In And Out Buttons For Pictures

Dec 16, 2014

I am trying to make a japplet that has open, zoom in and zoom out buttons for pictures. I am not sure how to go about an open button that will read the file. I have the picture url hard coded in the file to open but would like an open button with a file/folder dialogue.

This is what I have so far

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.event.ActionEvent;

[Code] ......

View Replies View Related

Syntax Highlighting In Editor?

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

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 View Related

Is There Any Java GUI Editor For Linux

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

Editor Does Not Contain A Main Type

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

Creating A Level Editor GUI

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

Swing Document Editor

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

Small Text Editor

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

Swing/AWT/SWT :: SetFont Of JTable Editor

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

JSP :: How To Create HTML Editor - Any Built In API For That

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

JavaFX 2.0 :: HTML Editor ValueProperty?

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

Tile Based Map Editor - Organize Layout

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

JSF :: Escape Characters Of Primefaces Editor To Do A Query On Sparql

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

Swing/AWT/SWT :: Custom JTable Renderer And Cell Editor

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

GUI Text Editor With Edit And Format Functions - Scroll Pane

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

Custom Jtable Cell Editor Throwing Illegal Component State Exception

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

Read Chars In Text Area And Produce Desired Output For Text Editor Project?

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

Creating Simple Text Editor - Delete Selected Text Inside Text Area

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

JSP :: Eclipse Project Window Shows Error But Code Editor Shows No Error

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







Copyrights 2005-15 www.BigResource.com, All rights reserved