Recover Text Displayed On Screen To A TXT File

Mar 18, 2014

Here I would like to collect automatically in a file ( txt) the characters displayed on the screen. I'm working on a system that the database is remote. To receive information, there is a terminal by which sends commands. The feedback is displayed only on the screen and you can only print. This is actually a terminal black screen, white character, such as command line "DOS" . The software can not export , or access to the database or other means of information retrieval .

I explored the track of the OCR . But the result produced is not consistent with the captured picture. How can I do this? I have no other tracks ....

View Replies


ADVERTISEMENT

JSF :: Submit Text That Will Be Displayed In List Of Paragraphs

Nov 17, 2014

I'm new to JSF and I'm facing a problem with displaying German umlauts correctly.

I have built a site that uses an inputText to submit text that will be displayed in a list of paragraphs (as simple html... <li><p>text</p></li> etc.). A managed bean is used as a controller to store data in backend and to retrieve it from backend for display. In backend the data is stored in a list of strings and using annotations this data is written to respectively read from file system on shutdown/startup via serialization. Sometimes when I'm sending German umlauts from my webbrowser they're not displayed correctly, other times however they are which is pretty weird to me.

I've built the project with NetBeans 8 and I made sure that under Properties -> Sources the Encoding is set to UTF-8. In the xhtml page for display the encoding is set as follwed:

<?xml version="1.0" encoding="UTF-8"?> //first line
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> //in the head
<h:form [...] acceptcharset="UTF-8"> //all forms surrounding the inputText and the paragaraph list

I'm developing on a Ubuntu 14.04 desktop. For deployment I transfer the .war file via ssh to my server which is Ubuntu server (currently not sure which version, might be 12) and there I deploy the .war file on my Glassfish server online.

An example of how the input appears when it's incorrectly displayed: ä

The same letter appears like this when it's correctly displayed: ä

Another example, incorrect: ö

correct: ö

Once the data is input its appearance won't change anymore so I assume the incorrect encoding happens already before the data is stored in backend. I'm not sure yet under which conditions the data is displayed incorrectly.

View Replies View Related

Scaling Text According To Screen Size

Jul 4, 2014

What I am creating is a clock. That goes round n round using "getcalendar". It's realtime, but the clock has a constant resolution of 800x800. I have carefully placed numbers from 1-12 on the clock using that resolution placing them pixel by pixel. Now if I resize the window, the clock resizes but the text, it fades away out of the screen because the resolution is too small.

This is how I draw them.

g2.drawString(six, 380, 750);
g2.drawString(twelve, 375, 70);
g2.drawString(nine, 30, 415);
g2.drawString(three, 725, 415);
g2.drawString(one, 570, 120);
g2.drawString(two, 690, 250);
g2.drawString(four, 685, 575);
g2.drawString(five, 570, 700);
g2.drawString(seven, 200, 710);
g2.drawString(eight, 80, 585);
g2.drawString(ten, 80, 235);
g2.drawString(eleven, 205, 115);

I understand why this is happening, obviously because the strings are in a certain place just can't understand how do I make them scaleable? Is there an universal formula? Or do I have to draw every string relevant to some mathematical equation regarding to the screen size.

For example : g2.drawString(twelve, diameter / 2, screenheight / 3);

View Replies View Related

JavaFX 2.0 :: How To Recover From Too Many Touch Points Reported Exceptions

Sep 17, 2014

I'm trying to stress test JavaFX and I'm on Window 8.1 using 1.8.0_20-b26. I have an application that has many objects on the scene with animation timers and overall it purposefully runs very slow. I have listeners on the root AnchorPane for touch input and if I generate many touch point events after a few minutes I get "Too many touch points reported" exceptions (posted below) and the app of course no longer responds to touch input. Is it possible to catch the exception and then reset the scene touch input so it goes back to normal without restarting the application? If it lost any current touch input that's fine.
 
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: Too many touch points reported
  at javafx.scene.Scene$ScenePeerListener.touchEventNext(Scene.java:2686)
  at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleNextTouchEvent$346(GlassViewEventHandler.java:1090)

[Code]....

View Replies View Related

How To Make A Text File Only Use Lines In A Text File Beginning With A Certain Letter

Mar 15, 2015

I have a program that reads lines of text, but some of the lines of text aren't applicable and break the program. I'd like to put a letter in front of the lines in the .txt file I want to use, such as a #.

I need to make an if loop that'll check for the first letter on the line being #, and use the line in the program if true and skip if false. I'm guessing a boolean variable would be useful here to be true or false depending on the presence of #, but I don't know how to only read the first letter of each line, how can I do this?

View Replies View Related

Pickup Selected Text File And Read Line By Line And Output Text Into Visual Text Pane

Dec 12, 2014

I am checking how to do following task.

01. pickup the selected text file and read the line by line and output the text in to visual text pane.

what i did:.

01. I wrote code that read the text file and output in to jave console/ also some of the interface.

the code read txt file:

Java Code:

String fileName = "C:/Users/lakshan/Desktop/lawyer.txt";
File textFile = new File(fileName);
Scanner in = new Scanner (textFile);
while(in.hasNextLine()){

[code]....

so it will read any text file dynamically and output to the text pane in interface. I think scanner code must be execute after the select the file from the browser and set the scanned result in to variable. then later out put the var as string in some jswing component?

View Replies View Related

Cardlayout Format - Change Main Menu Screen Into Game Screen On Button Click

Mar 16, 2015

I'm making a game of checkers for my A2 Computing coursework which is due in within a week. I have completely finished the game, and only thing I have left to do is connect the two JPanels together via a CardLayout that I have made. However I am unsure how to do so

Here is the code from my CardLayout:

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JButton;

[Code] ....

I have kept the code I am displaying to a minimal, hence I have removed all the action listeners for my buttons, anyway the problem I have is that, I would like it so that when the user clicks on the 'Multiplayer' button which is the array button ourButtons[1], it will then transition into my main game screen so that the user can then play a game of checkers.

Here is the main important GUI from my CheckerBoard class:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
  public class CheckerBoard extends JPanel implements ActionListener, MouseListener {
// Main routine that opens an Applet that shows a CheckerBoard
public static void main(String[] args) {
new CLayout();
 
[Code] ....

Once again kept to a minimal.

View Replies View Related

Reading A File / Sorting It And Displaying Its Content On Screen

Jan 19, 2014

I have a program that writes a user's input to a file.

The input consists of several loops. In each loop the user enters a student number, the student first name and last name and then several exam results. Each student has different number of exams, depend on the user input.

For instance, the input can be (explanations are in brackets but not in the actual file):

505 (student number)
efron (last name)
ben (first name)
3 (no. of exams)
88 (1st exam mark)
70 (2nd exam mark)

... and so on

I need to write a program that reads that file and writes it to the screen, but it needs to do it in ascending order according to the student number.

Leaving aside the format it will be displayed on the screen, my question is how should I sort the data by the student number?

I though about first reading each student as an array, but my problem is that each array contains different number of elements (depends on the number of exams) and also each array containד both strings (first and last names) and ints.

View Replies View Related

User Enter A File On Text Field And Display Its Hex Representation In Text Area

Apr 17, 2015

I'm supposed to write a GUI application letting the user enter a file on the text field and display its hex representation in a text area and vice versa.

Here's my code:

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package hexconvertor;
import java.util.*;
import java.io.*;
public class HexConvertor extends javax.swing.JFrame {

[Code] .....

It's not doing anything, I don't understand why.

View Replies View Related

Read Date From File / Calculate And Then Displays That Data In Table Format On Screen

Apr 22, 2015

The intent of the code is to read date from a file, does calculation and then displays that data in a table format on the screen. Then creates another file with those values:

Reads file: Beginningbalance.txt
Displays Data with calculation
Creates a file called "Newbalance.txt" with the following values:

111
251.41
222
402.00

With the way the code is written I can get it to create the file but it only displays one of the customers (111). I know that I need to create a loop but I am not sure how to build that. I tried creating another while loop and changing it to outFile but that was without success.

import java.io.*;
import java.util.Scanner;
import java.text.DecimalFormat;
public class Output {
public static void main(String[]args) throws IOException {

[Code] .....

View Replies View Related

Read A Text File And Split The Text Into Tokens

Feb 2, 2014

I am trying to read a text file into Java and split the text into tokens. Eventually I want to be able to count the number of instances of a specific word. However, at this point, when I run the file, all I get is the location of the file rather than the text in the file.

import java.util.*;
import java.io.*;
public class textTest3 {
/**
* Prints the number of words in a given file
*
* @param args
* @throws IOException
*/

[Code]...

View Replies View Related

Read Text File Into Object Array And Creating Random Access File

Dec 8, 2014

I am working on a project that requires me to build a database with random access file, representing products, the base product contains a name (about 30 characters), a price (double), and a quantity (integer). I have worked on this project for probably 15+ hours and have tried so many things and feel like I've barley made any progress...

The part i am really struggling with is taking the data from the text file and creating an object array with it using the product class. Once ive accomplished that, i have to use that data to create a random access file with the data.

Here is the base Product class that must be used to create the objects for the array.

public class Product
{
public String pName;
public String stringName;
public double price;
public int quanity;

[Code] .....

And then here is the data from the text file that i must extract to use to create product objects.

Dill Seed,938,34
Mustard Seed,100,64
Coriander Powder,924,18
Turmeric,836,80
Cinnamon (Ground Korintje),951,10
Cinnamon (Ground) Xtra Hi Oil (2x),614,31
Cinnamon (Ground) High Oil (1X),682,19

These continue for about 40-50 entries, they are not separated by a blank line though i had to add those so it would display correctly, each entry is on its own line with name separated with spaces, then price after a comma, then quantity after the second comma.....

View Replies View Related

Reading Text File Into Object Array And Create Random Access File

Dec 9, 2014

I am working on a project that requires me to build a database with random access file, representing products, the base product contains a name (about 30 characters), a price (double), and a quantity (integer). I have worked on this project for probably 15+ hours and have tried so many things and feel like I've barley made any progress...

The part i am really struggling with is taking the data from the text file and creating an object array with it using the product class. Once ive accomplished that, i have to use that data to create a random access file with the data. Here is the base Product class that must be used to create the objects for the array.

public class Product
{
public String pName;
public String stringName;
public double price;
public int quanity;

[Code]...

these continue for about 40-50 entries, they are not seperated by a blank line though i had to add those so it would display correctly, each entry is on its own line with name seperated with spaces, then price after a comma, then quanity after the second comma.....

View Replies View Related

Reading Text File Into Object Array And Creating Random Access File?

Dec 8, 2014

I am working on a project that requires me to build a database with random access file, representing products, the base product contains a name (about 30 characters), a price (double), and a quantity (integer). I have worked on this project for probably 15+ hours and have tried so many things and feel like I've barley made any progress...

The part i am really struggling with is taking the data from the text file and creating an object array with it using the product class. Once ive accomplished that, i have to use that data to create a random access file with the data.

Here is the base Product class that must be used to create the objects for the array.

public class Product
{
public String pName;
public String stringName;
public double price;
public int quanity;
//Constructor
public Product( String pName, double price, int quanity )

[code]....

and then here is the data from the text file that i must extract to use to create product objects.

Dill Seed,938,34

Mustard Seed,100,64

Coriander Powder,924,18

Turmeric,836,80

Cinnamon (Ground Korintje),951,10

Cinnamon (Ground) Xtra Hi Oil (2x),614,31

Cinnamon (Ground) High Oil (1X),682,19

these continue for about 40-50 entries, they are not separated by a blank line though i had to add those so it would display correctly, each entry is on its own line with name separated with spaces, then price after a comma, then quanity after the second comma.....

View Replies View Related

Read Text File Into Array Ask User To Save File And Print Data

Jul 14, 2014

New to programming. Am supposed to create a program that reads a text file (of integers) and computes a series of computations on these integers. I don't have the code for the integers in my code yet, (i know how to do those), but am struggling getting the array to simply print in the print writer. I have the user select a text file, read the file with a scanner, and then save the computations done from my code into another file. specifically, the problem is as follows: Write a program that uses a file chooser dialog to select a file containing some integers. The file contains an integer N followed by N integers. The program then uses a file chooser dialog to let the user specify the name and location of an output file to write results to.The data written to the output file will be as follows

(1) The original list of N numbers from the input file,
(2) The original list of N numbers printed in reverse order of how they appear
in the input file.
(3) The sum and average of these numbers,
(4) The minimum of all the numbers,
(5) The maximum of all the numbers.

[import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;

[Code]....

View Replies View Related

Creating A System That Will Ask User To Create A File That Will Store To Text File

Mar 9, 2015

I am new to java and I am creating a system that will ask the user to create a file that will store to a text file, Once the user created the file I have a class that will let the user input the subject name that has been created, However, I keep on getting this java.util.nosuchelementexception.Here's my code:

public void display_by_name()
{
String id, name,total;
String key[]=new String[30];
String value[]=new String[30];
int i=0;

[code]....

View Replies View Related

File Handling - Display Path Of The File In Text Field

May 6, 2014

I am facing a problem while executing a task. My task is to make such a code which will search for my source code file (abc.java) in all directories and then displays the code in textarea inside frame and along with that i also have to display the path of the file in text field. I have coded something but i am really not getting anywhere near my task.

import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.util.*
 
public class Lab extends JFrame {

[Code] ....

View Replies View Related

Program For Adding One Text File Into Zip File Without Extracting

Apr 9, 2015

java code for adding one text file into the zipped file without extracting It is possible in java code ?

View Replies View Related

I/O / Streams :: Retrieving File Directories From A Text File?

Jun 25, 2014

Let's say I have a text file and in the text file exists file directories as such:

'assets/picture1.png'
'assets/picture2.png'

And so on...

How would I then read from this text file and then create those files using 'new File()'?

Here is my code:

private void getFiles() throws IOException{
files = new File[10];
Scanner scan = new Scanner(new File("files.dat"));
int count = -1;

[Code]....

It does print out those files, but it doesn't create them.

View Replies View Related

How To Create Jar File Of Program With Text File

Jan 29, 2015

i have made one desktop application with swing and i have uses one textfile (File) in it. i want to handover to another friend to use it . How to create jar file of that program with that text file so that my friend use it without any issue . I have made it in NetBeans

View Replies View Related

Conversion Of Excel File Into Text File

Oct 28, 2014

I am a beginner in Java and I have a task of reading excel document and converting it into a text file.

View Replies View Related

Objects Being Displayed On Top Of One Another?

Dec 15, 2014

I am making a game in java and for the game board i want to fill the screen with blocks. to do this i stored objects of a class that displays squares into an array list and displayed the array list. however, when i do this all of the squares are drawn on top of anther at the final squares coordinates and i dont know why.

here is the code

// code for adding the squares into the array
nt x = 0;
int y = 0;
int size = 10;
static ArrayList<Map> map = new ArrayList<Map>();
//static ArrayList<Items> items = new ArrayList<Items>();

[code]....

View Replies View Related

Why Is Output Not Being Displayed

Jan 14, 2015

I am writing this program for my Java level 1 class. I am able to get it to compile and run, however nothing is outputted. Below are the instructions and the code that I have written.

Instructions:

Write an application that calculates and displays the amount of money a user would have if his or her money could be invested at 5 percent interest for one year. Create a method that prompts the user for the starting value of the investment and returns it to the calling program. Call a separate method to do the calculation, and return the result to be displayed.

Below is the code that I have written

import java.util.Scanner;
public class Interest
{
//main method
public static void main(String[] args)
{
originalAmount();
Scanner input = new Scanner(System.in);
 
[code]....

View Replies View Related

JSF :: Some RowSet Info Not Being Displayed?

Apr 22, 2015

I am reading from a database(SQL Server 2012) and storing that information in a ResultSet. I am then trying to display that information using a DataTable.

Here is my managed bean

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package clientspage;
import java.io.Serializable;

[Code].....

The ID and the commandLinks are being displayed but the Client is not.

View Replies View Related

JSP :: Formatting Amounts To Be Displayed

Mar 26, 2004

How to go for formatting amounts to be displayed using JSP?

View Replies View Related

Changing JList That Is Already Displayed

Nov 5, 2014

I have a empty JList in which I hit a button LOAD DATA which should load all the data. but once I load data i try to fill in the List but I keep getting errors.

String[] aos = new String[itrList.size()];
itrList.toArray(aos);
//JList listFAIL = new JList(aos);
//list = new JList(itrList.toArray());
//list.removeAll();
list.setListData(aos);
JScrollPane s = new JScrollPane(list);

I have tried doing setListData and i get a error;

And if i do new Jlist it doesn't change the data.

The List does fill as i have a checker for that.

View Replies View Related







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