Properties File - need some help
hello, Im trying to figure out how to work with the Properties class. I think it can handle what i'm trying to accomplish. Maybe someone can point me in the direction of some rookie material to read. But anyway heres my dilemma. I need to create some form of structured message that can be saved (properties file), but i don't know how to structure it in the way specified.
For example, say the message has 3 fields: ID(unsigned int), TIME(unsigned long int), and SIZE(unsigned int)
I want ID to take up the first 2-bytes of the message, TIME to take the next 4, and SIZE have the remaing 4. Whats the best way to create this? I'm new to this stuff, and looking for some direction...i don't know where to start
Take a look at the API docs for java.io.DataOutputStream and java.io.DataInputStream. If you are serializing these to the filesystem, you will want to wrap a java.io.FileOutputStream and java.io.FileInputStream with the appropriate data stream type.
- Saish
Similar Messages
-
2 seperate class files, need some help
Hi,
Um, incase you didn't notice, I'm new to java. The closest to Java that I've ever been was C#. But anyways:
I have 2 class files. One of them is a main form, and the other one is a simple dialog form. Is there a way that I can make the main form show the dialog form say, by clicking a button? I know how to create a button and do something when the button is clicked, I just don't know how to make one form show another one without having the code for both forms in one file. By the way, I'm making it in Swing if that makes a difference. Also, code examples would help, thanks.Hi,
Um, incase you didn't notice, I'm new to java.The way about every second posts starts in here. Thanks for pointing it out, I wouldn't have guessed. :p
The
closest to Java that I've ever been was C#. But
anyways:
I have 2 class files. One of them is a main form, and
the other one is a simple dialog form.
Is there a way
that I can make the main form show the dialog form
say, by clicking a button?Yes, of course.
I know how to create a
button and do something when the button is clicked, I
just don't know how to make one form show another one
without having the code for both forms in one file.Uhm. Just something similar to
MyDialog d = new myDialog(theFrameToBeModalTo);
d.show();?
What does it have to do with files? Java doesn't care about files.
By the way, I'm making it in Swing if that makes a
difference. Also, code examples would help, thanks.All code examples you need are here:
http://java.sun.com/docs/books/tutorial/ -
Ok i have indesign CS6 and all files are stored on a 10.7.5 MAC server. This just started happening. When I open a file indesigns is creating a textfile in the same folder? I need some help on this.
Ask in the ID forum and be much more specific about your configuration. there could be any number of reasons why manifests, temp files or restore files are created.
Mylenium -
Remote App on iPad connects but drops after about 20 mins. Need to turn off wait about 1 minute, then turn on wifi on iMac before it can reconnect. Need some help please.
Already gone through troubleshooting guide a zillion times. Thanks.This worked for me... A little time consuming but once you get rolling it goes GREAT... Thanks....
I got my artwork and saved it to my Desktop
Opened up Microsoft Paint and clicked on "File" and "Open" and found it to get it on the screen to resize it
Clicked "resize" and a box for changing it opened up
Checked the box "Pixels" and "Unchecked maintain aspect ratio"
Set Horizontal for 640 and Vertical for 480
Clicked on "OK" and went back to "File" and did a "Save As" and chose JPEG Picture
It came up "File Already Existed" and clicked "OK" (really did not care about the original artwork I found because wrong size)
Went to iTunes and on the movie right clicked on "Get Info", clicked on "Details", then "Artwork"
Go to the little box on the top left that shows your old artwork and click on it to get the little blue border to appear around it and hit "Delete" to make it gone
Click on "Add Artwork" and find it where you put the one from above on your Desktop and hit "Open" and OK and your new artwork is now there and all good.
Sounds like a lot of steps to follow but after around 5 or so you will fly through it. This worked perfect on my iPhone 6 Plus and I have artwork on my Home Videos now. -
TS1702 I need some help the apps were downloading slowly
The apps downloaded but it didn't cause it's stuck in downloading mode what should I do?
The iOS 6 update didn't work.
Please I need some help.
The apps didn't download.
Talking Angela and Ginger didn't download.
Talking Santa didn't update.Try moving the existing backup file to a safe location so that iTunes has to create an entire new file. The backup file is located here. You can delete that backup once you get a successfull backup.
iTunes places the backup files in the following places:
Mac: ~/Library/Application Support/MobileSync/Backup/
Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
Windows Vista and Windows 7: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
Note: If you do not see the AppData or Application Data folders, you may need to show hidden files (Windows XP, Windows Vista and Windows 7), or iTunes may not be installed in the default location. Show hidden files and then search the hard drive for the Backup directory. -
Hi! I got Movies on my external hard drive that are AVI kind and won't play on my macbook pro? When I start playing the movie a message pops up and says "a required codec is not available". I tried flip4mac, xvid, divx already and still not playing my video. need some help please!! thanks.
Although vlc mentioned above is a much more powerful and better player you could try installing Perian if you insist on using the quicktime player. It may supply the codec it needs.
Not sure why you wouldn't be able to play straight avi files though in quicktime. -
Need some help with putting a folder in users directory
I'm not sure how to do this, but what I want to do is put this file in C:/My Documents, but I need to be able to verify that C://My Documents exists, if not put it in C:/Program Files.
Can any one help me out?
try {
String[] contactArray = parseDatFile(fc.getSelectedFile());
Document document = createXMLDocument(contactArray);
saveToXMLFile(
document,
new File(
"C:/Program Files/xxx/",// looks for directory for list
"xxxxxxxxxxxxxxxxxxxxxxxxxxxx"));
} catch (Exception exc) {
File f = new File("C:/Program Files/xxx/");// setting directory for list if not there
boolean yes = true;
yes = f.mkdir();// creating directory
try {
String[] contactArray = parseDatFile(fc.getSelectedFile());
Document document = createXMLDocument(contactArray);
saveToXMLFile(
document,
new File(
"C:/Program Files/xxx/",// used only if the directory didn't exist
"xxxxxxxxxxxxxxxxxxxxxxx"));Need some help with putting a folder in users directoryI recomend using System.getProperty( "user.home" ) not a hard-coded value.
This will use the users home folder ( C:\My Documents ) on Win9X (I guess), C:\Documents and Settings\<current user> on Win2K +, and ~ on Unix-a-likes. -
Need some help in LiveCycle Designer ES 8.2
Hi i need help with tables in livecyckle.
Example. I create one table with 32 rows and 8 numretic cells, and another table below with 1 row and 8 numretic cells.
In the big table i can input numbers and working fine.
now to my problem. Ex, i want to input number 12 in row 1 cell 3.and then again same number 12 in row 2 cell 3 and i want the result (24) in table 2 row 1 cell 3. is there anyboby who can help me with that See below
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
Header 7
Header 8
12
3
5
12
7
9
4
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
Header 7
Header 8
4
24
10
14
Best regards StigHi again Steve and thanx for the reply..send you a coupie of my file.
All text on it is in swedish so i can explain a little for you.
Text Veckodag is Weekday,Tim is hours. Frånv. is a shortname for sickness,
Dagtid is daytime Kväll is evening, Helg is weekends, Afton is Big weekend
like christmas day, s-helg is a shortname for big weekendsdays like day
after christmas day, Jour is jour. The field to the left with numbers is
date. Totalt is total
The only fields i need some help with is the field from Tim to Jour. And the
result should apear in the last fielt Totalt
Can also tell that im not so good in english but im learning. And the last
thing of all :Happy easter to you and thanxs again.
Stig in sweden My E-mail adress is [email protected] -
I need some help.... I Have the iPhone 4S and downloaded the new software (6.0) and everything seems great so far except when I try to open a link in safari from a different app (ie..messages, Facebook, ect..) it glitches and won't load. The blue loading bar will just jump back and forth and the page will not load properly if at all....
It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
http://www.adwaremedic.com/kb/baddns.php
http://www.adwaremedic.com/kb/hackedrouter.php
If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
(Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.) -
i need some help. im getting error -69 when trying to sync my ipod. i dont kno what to do. ive tried googling as much info as i can on this subject but i cant seem to find a answer to get me off to a good starting point. i back all my music up on a external hard drive.
If the file was not originally from iTunes, you'll need to redownload it from it's original source or rerip it from the CD. Files can sometimes go bad and become corrupted. As to how or why that happens, there are a number of ways.
What format are the problematic tracks in? Have you tried converting them to another format in iTunes?
iTunes: How to convert a song to a different file format
B-rock -
Trying to make a photo contest need some help
Trying to make a photo contest need some help. I am running a
fish photo contest on my website and was wondering if any of you
could give me some advice on some good extensions to help me do
this easier. Basically I want a page where people upload a file and
then it automatically resizes the image and puts it on a page,
where people can vote on the pictures.Hi Pilot,
Column B contains the sale amounts.
Column C will contain the tax amounts.
I'm assuming a header row, and the first line of data to be row 2.
In C2, enter: =B*20%
Click Accept, then use the mouse to drag the small round handle at the lower right of the selected cell (C2) to fill the formula into the rest of the cells in column C.
This simple version of the formula will put zeros in all column C cells where no amount has been entered in the corresponding cell in column B. The revised formula below takes care of that.
C2: =IF(B,B*20%,"")
I'd strongly suggest that 'rookies', as you describe yourself, download and read both the Numbers User Guide and the Functions and Formulas User Guide. Both are available from the Help menu in Numbers. If you use Pages and Keynote, you should use the Help menu in those applications to download their User Guides as well. The guides are searchable pdf files, well written, easy to read, and useful to rookies and old hands as well.
Regards,
Barry -
Hi,
I need some help to try to understand some of my issues; i'm creating a catalogue for a company and i'm uploading TIFFs pictures (600 of them). My problem is that this catalogue is both for print and web but is getting really heavy as a file, is there another way to convert all the pictures and maintain the quality for print and a reasonable size for web?
I'm uploading TIFFs because i need the transparency and i can't upload as PNG...
Can someone help me please.
I really appreciatealanpires wrote:
... this catalogue is both for print and web ...
Choose either file size (for web) or image quality (for print). Something has to give.
This "for web" business, is that still a PDF? Then export for print with full resolution, and export another version to put online where yo adjust the export settings for the web until image quality is worse than having a megabyte or two more. -
Need some help with GUI development
Hi ppl.. I am new to labview and I am currently involved in a testing equipment development. I need some help. firstly I need to know if multi-screen GUI (with icons and stuff)is possible in Labview. Secondly I need to interface the measurements to a database. Would it be possible to create just small executable to perform the measurement part alone and do the rest of database operation using VB. (or would it be advisable to do the whole lot in labview)
the final sft should look something like this
screen1 :setup screen... interface with database
screen2 :actual test and test results
screen3 :log file creation
measurement is via daq board and i also need to send some control signals and set up TCP/IP for data transfer.Hello.
I am not completely sure what you mean by "multi-screen", but I am pretty sure that doing the user interface using a tab control will work for you. I have attached an example VI which is a state machine (which in LabVIEW you do with a case structure inside a while loop). Notice how the configuration controls are in the first page of the tab control, associated with state 0 of the state machine, but in the block diagram, they are actually used in state 1 of the state machine. Instead of writing a very long description, I will let you take a look at the code (which I saved in LV 7.0 version). Let me know if you have questions or comments
Attachments:
MultiScreenStateMachineExample.vi 50 KB -
Need some help with region position
Hi,
I need som help with regions position....
Background:
I have 2 regions, I will call them reg1, reg2 and reg3.
reg1 = Page Template Body (2. items below region content), column 1, search region.
reg2 = Page Template Body (2. items below region content), column 2, import file region.
reg3 = Page Template Body (3. items above region content), column 1, search result, grid region, very wide.
Issue with the position, the setup explained makes my layout like this
reg1--------------------------------reg2
------------------reg3--------------------
What I want:
reg1-reg2
------------------reg3--------------------
What am I doing wrong?
Regards DanielDaniel,
this will also work:
Region1 HTML table cell attributes
width="10%"
Region2 HTML table cell attributes
align="left"
without touching the page template.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Need some help with Flash + Captivate (ActionScript in Flash)
I have what I think is a fairly simple question.... I have an SWF File embedded in a Captivate 4 Presentation. The SWF requires the user to click on a variety of items, after they have gone through all the required items a "FINISH" button appears... I want the finish button to "close" the SWF file.
I'll add this info to in case it helps with the "right" answer....
The reason I am doing this is because Captivate automatically rolls from one "slide" to the next. The only way to stop this is to add a "pause" button to the slide, I want the user to have to finish the SWF before they can see the "next" button in the captivate file...So I was thinking, put the "swf" over the "next" button... then have the "complete" button close the swf revealing the covered "next" button in captivate....
The short version of what I need is information on closing an SWF file via a button click. Is there a "swf.visible=false" or anything like that?Need some help with putting a folder in users directoryI recomend using System.getProperty( "user.home" ) not a hard-coded value.
This will use the users home folder ( C:\My Documents ) on Win9X (I guess), C:\Documents and Settings\<current user> on Win2K +, and ~ on Unix-a-likes.
Maybe you are looking for
-
PO Response approval Work item is not executing from approver inbox.
Hi, PO Response approval Work item is not executing from approver inbox. After click the approve button system is not showing any error and also work item is not clearing from user inbox. When we checked the status of the work item in SWI1 Transactio
-
Any pre keyed effect sites that work with adobe premiere elements 11?
I have been trying to find a legit non scam/virus site with pre keyed effects like explosions, gunshot fire, fire, and other effects like that. Most sites that I've tried are virus' or only work with imovie. Anyone know of any good sites that have pr
-
I backed up my 3GS using iTunes. I then restored the file to my new 4GS. Then I synced the apps onto the 4GS. Then I downloaded 2 custom ringtones, and attempted to sync them onto the 4GS, but it says "This Library is already synced with another phon
-
Hi, I got BT fot 1 year and everything was all right. But for 3 days now it's very slow. Normaly I got 5m, now it's 300ko ! Stange thing : It was working at 3am this morning (5mega), but not anymore. I tried to reset/restart the box, it still the s
-
So I am trying to make some flashcards. I have little 1 second mp3s of vocabulary words. I attached each mp3 to each slide. When I publish it, some of the words get cut off. For instance, if mp3 plays the word "disseminate", then presenter will