All Questions
Tagged with fixed-width java
23
questions
20
votes
10
answers
61k
views
Parsing a fixed-width formatted file in Java
I've got a file from a vendor that has 115 fixed-width fields per line. How can I parse that file into the 115 fields so I can use them in my code?
My first thought is just to make constants for each ...
19
votes
2
answers
249k
views
How to Set JPanel's Width and Height?
I'm developing Snake game using Java. Board's (where all action takes it place) width and height should be fixed (640 pixels * 480 pixels).
Structure:
Main class that extends from JFrame class,
...
9
votes
1
answer
14k
views
Java printing string with fixed width
I have to write a code in Java that will take a String and put a certain number of characters on each line (the fixed width). I will also have to put extra spaces in to fill in any extra spots, like ...
7
votes
4
answers
33k
views
Fixed width, variable height in JPanel with flow
I have an annoying problem with Java’s layout managers. I have the following situation: In a panel A are two other panels B with an absolute layout and C with a FlowLayout. B is highly customized and ...
5
votes
1
answer
8k
views
Fixed-width floating point number format
In Java, I have the following code:
System.out.printf("%05.5f", myFloat);
This works well for any numbers which are less than 10, but for any number 10 or greater, the decimal places are trimmed to ...
4
votes
1
answer
20k
views
Generating report as txt file - How to set the exact positions and sizes for texts in Column Header and Detail bands
We have a requirement where text reports are to be generated using JasperReports.
The precision has to be accurate, sample format is as follows
Header user name has to start at column 0.
Header last ...
4
votes
0
answers
229
views
Problems with big fixed-width flat files
I'm trying to read a fixed-width flat file with JRecordBind. Each line can be a subrecord of the previous one and the first line and the last one are header and footer of root record.
Example:
...
3
votes
4
answers
14k
views
Java Swing: Vertical Layout with fixed width and variable height
I'm looking for a layout manager (or set of layout managers) that help me to arrange my components vertically. All components (buttons) should have the same width, bordered by the underlaying dialog ...
3
votes
4
answers
2k
views
Alternative to Fixed-Size Arrays in Java?
[Context: new to Java, 4 months tops; old hand at C++.]
I'm working on a library that requires an array of a fixed size ("fixed string") in many places. I'm trying to use Dependency Injection (q.v.) ...
2
votes
1
answer
2k
views
Fixed-Width But Fluid-Height Component - Possible?
If you use setPreferredSize() on a component, it fixes both width and height. Therefore, this is no good if I only want a fixed width, and to adapt the height as necessary to accommodate the contents ...
1
vote
1
answer
1k
views
Using bitmap fonts in Netbeans
Is it possible to use bitmap (.fon) fonts in Netbeans? I have a font I particularly like (Raize font) and I don't see it anywhere on the list when I try to set it as the editor font.
I can use it in ...
1
vote
6
answers
3k
views
Reading a Huge Fixed Width file
I Have a requirement to read a Huge Flat File, without keeping the entire file in memory.
It is flat file with multiple segments, each record starting with a Header record identified by 'H' in the ...
1
vote
1
answer
2k
views
How to give fixed percentage value of column width in iText JAVA
Here I am using iText 7 for generations of pdf. I have set table width 100% using
table.setWidthPercent(100) and i want fixed column width which is in percentage.
I set column width like below
float ...
1
vote
1
answer
332
views
Univocity-parsers FixedWidth parsing with multiple records per line
I am trying to use the univocity-parsers to parse a fixed-width formatted file that includes a variable number of fixed-width records per line.
Format is record id [6], # of sub-records [3], sub-...
1
vote
0
answers
774
views
flat pack java for multiline records or multi line fixed width files
I am using net.sf.flatpack and new to fixed length file parsing. Does flatpack support mutlilined files or files with different fixed length records?
for example:
myfile
AAA000 SOMETHING 0001 - ...
1
vote
0
answers
73
views
To set a fixed-size icon in a JLabel [duplicate]
I have a JPanel inside my bigger JPanel and i want to add image and change it in the run-time. And i need that image in the smaller panel resized to a fixed size in execution of the program. I managed ...
0
votes
2
answers
2k
views
Parsing Cobol fields description from Java [closed]
I have to parse a text like this:
000001 01 ROUTINE_NAME.
000002 *
...
0
votes
3
answers
4k
views
Parsing multi-line fixed-width files
I have a fixed-width flat file. To make matters worse, each line can either be a new record or a subrecord of the line above, identified by the first character on each line:
A0020SOME DESCRIPTION ...
0
votes
1
answer
184
views
Univocity master detail relationship beans
I have a fixed structured file like this
5 type records, GM, AB, TM, DM, IN
TM and DM as you see is a master-detail relationship
but also DM and IN are in a master-detail relationship
GM01012020
...
0
votes
0
answers
68
views
Parsing multiple category groups from Fixed Length File
I am using BeanIO to parse records from a fixed length. For now, it works great. Now I have a new input file which has 2 different record groups as below.
Title xxxxxxxxxxxxxxxxxxxx
Dummy Line
Dummy ...
0
votes
0
answers
734
views
Java Format number: Fixed length, variable precision
I do have a text file which contains numbers with a fixed maximum length and a variable precision:
Maximum precision 14
maximum length 16 (precision + decimal-point + integer number)
optional/...
0
votes
1
answer
62
views
I am trying to decrease the width of a text using arrays in java, but java is returning a single error
I am trying to decrease the width of a text, and in line 19 of my code java returns the error cannot find symbol. Here is my code up to the line containing the error:
public class FixedWidthPrinting{...
0
votes
2
answers
2k
views
How to create .avro file from a fixed width text file?
I would like to generate .avro file from a text file with fixed line width. I am beginner with java and .avro, so please help me in sorting out this problem.
How to create .avro file from a fixed ...