Problems previewing file and with flash action
I am using Acrobat.com for my children's book in order to send it out to agents and it has been working well since October. I have checked it several times and there were no issues but today it will not preview either file any longer and the flash page turner is no longer working. I upoaded a new version of the same file and it is working but the link I sent out to agents will only allow a download now. Just wondering what may have caused this. I read where someone else had a similar issue but there was no result posted. The page turning issue, though not really an important feature, is just something I really liked about the program. Thank you.
Hello,
This should have been a temporary issue - the preview function should be working normally for the new file now. Please lmk if this is not the case.
Michelle
Similar Messages
-
I have the latest downloadable version of LR5. It crashed while it was createing 1:1 previews during an import. After a Win7(64) restart, it shows a message that LR needs to quit because it can't read the preview files and it will try to fix it the next time is launches. I get the same message the next and every subsequent time it launches so I can't launch LR at all now.
I get that the preview file got corrupted somehow. Is there some way to fix this problem without building a new catalog?Use Windows Explorer to open the folder containing your catalog. You will see a folder with the extension .lrdata. You need to delete that folder and then start Lightroom again. Lightroom will generate a new previews folder.
-
I deleted the preview files and now the sequence on the timeline is missing
I deleted the preview files to save disk space by doing Sequence/ delete render files, now the sequence on the timeline window is missing. what can i do te recover the already assembled sequence on the timeline?
Help please!!!
ElioFirst, are you sure that you deleted the Preview files, and not your media files? Can you check in Windows Explorer, that your media files are still where you had them?
Next, if it was the former, and not the latter, this should not happen. Did PrPro give you any sort of message, when you loaded your Project? Something like "where is file xxxx.AVI?"
There are instances where Sequence Timelines do not appear in the Timeline Panel. I'd not think that this would be one of those instances, but... is your Sequence still showing in the Project Panel? What happens if you Dbl-click on it there?
Do start checking the sales for hard drives. Editing video without enough hard drive real estate is asking for problems. It will be money well-spent.
Good luck,
Hunt -
Safari and Firefox Problems... possibly with flash plugin.
A couple days ago out of nowhere Firefox was crashing whenever i went to... well, most websites. Most noticeably Youtube and Tumblr. So I downloaded the newest versions of firefox and a plugin that was out of date, and the Flash plugin. It still crashed-- nothing changed.
So I moved on to Safari, it didnt crash when i went onto those sites. but i get a pop up message all the time, especially on those sites...
Process: WebKitPluginHost [38557]+
Path: /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS /WebKitPluginHost+
Identifier: com.apple.WebKit.PluginHost+
Version: 6531.21 (6531.21.1)+
Build Info: WebKitPluginHost-65312101~2+
Code Type: X86 (Native)+
Parent Process: WebKitPluginAgent [37210]+
PlugIn Path: /Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player+
PlugIn Identifier: com.macromedia.Flash Player.plugin+
PlugIn Version: 10.0.32.18 (1.0.4f18472)+
Date/Time: 2009-11-17 21:40:06.966 -0700+
OS Version: Mac OS X 10.6.1 (10B504)+
Report Version: 6+
Interval Since Last Report: 5253 sec+
Crashes Since Last Report: 39+
Per-App Interval Since Last Report: 56 sec+
Per-App Crashes Since Last Report: 39+
Anonymous UUID: 7F2FCF04-0A33-42A2-8200-43E88911D912+
Exception Type: EXCBADACCESS (SIGBUS)+
Exception Codes: KERNPROTECTIONFAILURE at 0x0000000013e06840+
Crashed Thread: 0 Dispatch queue: com.apple.main-thread+
thats the message.. theres a lot more. But that makes me think its something wrong with the Flash plugin. Maybe the same thing is wrong with Firefox...
I have tried uninstalling with the uninstaller from the adobe website and reinstalling.
Is anyone else having this problem?
How do I fix it?I believe the WebKitPlugInHost needs to be updated for Safari as It crashes whenever I am playing FarmVille on FaceBook.
-
Does firefox have the same problem as internet explorer with flash player
IE is having problems with adobe flash player. Before I download it on Mozilla platform I need to know if Mozilla is also having issues with flash player.
There are some known issues with the Shockwave Flash plugin for Firefox that some are suffering from, so you will have install the plugin to see if you need to take action and how the plugin works.
In case there are problems with current Shockwave Flash plugin versions, you can try this:
*disable protected mode in the Flash plugin (Flash 11.3+ on Windows Vista and later)
*disable hardware acceleration in the Flash plugin
See also:
*http://kb.mozillazine.org/Flash#Troubleshooting
A possible option is to set the Flash plug to click-to-play by setting the permissions for Flash to "Ask To Activate" in "Firefox/Tools > Add-ons > Plugins".<br />
That way you can activate the Flash plugin when you need it via the Lego block icon on the location bar. -
Find and replace with multiple files and with a watch folder
I am trying to create a watch folder that uses red_menace script to:
1. Have a folder that receives multiple xml files that run the script one by one.
2. then move the files to an output folder.
I tried modifying the set TheFIle to choose file -- the original text file to:
with multiple selections allowed
But that doesn't seem to work. I know i'm missing a step. Any help is much appreciated!
Thanks!
The way i'd like to setup things is having an input folder on the desktop (or just have the application on the desktop and I can drag the files onto it), and let it do it's thing. Once it's done have it export the xml files into an output folder.
Here's what i got so far:
on open
set TheFIle to choose file -- the original text file
set TheFolder to ("Macintosh HD:Users:user1:Desktop:out") -- the folder for the output file
set TheName to (GetUniqueName for TheFIle from TheFolder) -- the name for the output file
set TheText to read TheFIle -- get the text to edit
set Originals to {"KPCALDATE", "KPCALEVENT", "KPCALDAY", "KPCALBODY", "obituaries name", "" & return & "</cstyle></pstyle>" & return & "<pstyle name=\"obituaries text\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>", " .com", " .net", " .org", " .edu", "www .", "www. ", "Ho- nolulu", "<pstyle name=\"kicker 12\"><cstyle allcaps=\"1\">fashion news</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "<component name=\"Headline 1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline 1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 36\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>-", "-", "
Per serving:", "<pstyle name=\"Titlebar - mini, red\"><cstyle allcaps=\"1\">NATION & World </cstyle><cstyle allcaps=\"1\">Report</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "</cstyle></pstyle>"} -- the terms that can be replaced
set Replacements to {"subhed", "subhed", "subhed", "Normal", "obituaries text", ", ", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>
", ".com", ".net", ".org", ".edu", "www.", "www.", "Honolulu", "", "<component name=\"Headline1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 27\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>", " ", "
Per serving:", "","" & return & "</cstyle></pstyle>"} -- the replacement terms
repeat with AnItem from 1 to count Originals
set TheText to (replaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
end repeat
try -- write a new output file
tell application "Finder" to make new file at TheFolder with properties {name:TheName}
set OpenFile to open for access (result as alias) with write permission
write TheText to OpenFile starting at eof
close access OpenFile
on error errmess
try
log errmess
close access OpenFile
end try
end try
end open
to GetUniqueName for SomeFile from SomeFolder
check if SomeFile exists in SomeFolder, creating a new unique name if needed
parameters - SomeFile [mixed]: a source file path
SomeFolder [mixed]: a folder to check
returns [text]: a unique file name and extension
set {Counter, Divider} to {"00", "_"}
-- get the name and extension
set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
if TheExtension is missing value then set TheExtension to ""
set TheName to text 1 thru -((count TheExtension) + 2) of TheName
set NewName to TheName & "." & TheExtension
tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
repeat while it contains NewName
set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
set NewName to TheName & Divider & Counter & "." & TheExtension
end repeat
end tell
return NewName
end GetUniqueName
to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
displays a dialog for multiple item edit (note that a return is used between each edit item)
for each of the items in SomeItems, a line containing it's text is placed in the edit box
the number of items returned are padded or truncated to match the number of items in SomeItems
parameters - SomeItems [list]: a list of text items to edit
TheTitle [boolean/text]: use a default or the given dialog title
ThePrompt [boolean/text]: use a default or the given prompt text
returns [list]: a list of the edited items, or {} if error
set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
if TheCount is less than 1 then return {} -- error
if ThePrompt is in {true, false} then -- "with" or "without" Prompt
if ThePrompt then
set ThePrompt to "Edit the following items:" & return -- default
else
set ThePrompt to ""
end if
else -- fix up the given prompt a little
set ThePrompt to ThePrompt & return
end if
if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
set TheTitle to "Multiple Edit Dialog" -- default
else
set TheTitle to ""
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
repeat with AnItem from 1 to TheCount -- pad/truncate entered items
try
set the end of TheItems to (item AnItem of TheInput)
on error
set the end of TheItems to ""
end try
end repeat
return TheItems
end EditItems
to replaceText of SomeText from OldItem to NewItem
replace all occurances of OldItem with NewItem
parameters - SomeText [text]: the text containing the item(s) to change
OldItem [text]: the item to be replaced
NewItem [text]: the item to replace with
returns [text]: the text with the item(s) replaced
set SomeText to SomeText as Unicode text -- TID's are case insensitive with Unicode text
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
set {ItemList, AppleScript's text item delimiters} to {text items of SomeText, NewItem}
set {SomeText, AppleScript's text item delimiters} to {ItemList as text, TempTID}
return SomeText
end replaceText
Message was edited by: gamebreakersWhen you use the open or adding folder items to handlers, you need to add the parameters for the file items passed to them.
I'll go ahead and post the applet/droplet version of my original script from the previous topic for reference:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFEE80;
overflow: auto;"
title="this text can be pasted into the Script Editor">
-- search and replace multiple items applet/droplet/folder action
-- the terms to replace - edit as needed
property EditableItems : {¬
"one", ¬
"two", ¬
"three", ¬
"four", ¬
"five", ¬
"six", ¬
"seven", ¬
"eight", ¬
"nine", ¬
"ten", ¬
"eleven", ¬
"twelve", ¬
"thirteen", ¬
"fourteen", ¬
"fifteen", ¬
"sixteen", ¬
"seventeen", ¬
"eighteen", ¬
"nineteen", ¬
"twenty"}
-- the folder for the output file(s) - change as needed
property TheFolder : (path to desktop)
property LastEditItems : EditableItems
on run
the applet/droplet was double-clicked
open (choose file with multiple selections allowed)
end run
on open TheItems
items were dropped onto the applet/droplet
parameters - TheItems [list]: a list of the items (aliases) dropped
returns nothing
repeat with AnItem in TheItems
ReplaceMultipleItems from AnItem
end repeat
end open
on adding folder items to this_folder after receiving these_items
folder action - items were added to a folder
parameters - this_folder [alias]: the folder added to
these_items [list]: a list if items (aliases) added
returns nothing
repeat with AnItem in these_items
ReplaceMultipleItems from AnItem
end repeat
end adding folder items to
to ReplaceMultipleItems from SomeFile
replace multiple text items in SomeFile
parameters - SomeFile [alias]: the file to replace items in
returns nothing
set TheName to (GetUniqueName for SomeFile from TheFolder) -- the name for the output file
set TheText to read SomeFile -- get the text to edit
set Originals to (choose from list EditableItems default items LastEditItems with prompt "Select the terms to replace:" with multiple selections allowed) -- the specific terms to replace
set LastEditItems to Originals
set Replacements to (EditItems of Originals with Title given Prompt:"Edit the following replacement terms:") -- the replacement terms
repeat with AnItem from 1 to count Originals
set TheText to (ReplaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
end repeat
try -- write a new output file
tell application "Finder" to make new file at TheFolder with properties {name:TheName}
set OpenFile to open for access (result as alias) with write permission
write TheText to OpenFile starting at eof
close access OpenFile
on error errmess
try
log errmess
close access OpenFile
end try
end try
end ReplaceMultipleItems
to GetUniqueName for SomeFile from SomeFolder
check if SomeFile exists in SomeFolder, creating a new unique name if needed
parameters - SomeFile [mixed]: a source file path
SomeFolder [mixed]: a folder to check
returns [text]: a unique file name and extension
set {Counter, Divider} to {"00", "_"}
-- get the name and extension
set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
if TheExtension is in {missing value, ""} then
set TheExtension to ""
else
set TheExtension to "." & TheExtension
end if
set {NewName, TheExtension} to {TheName, (ChangeCase of TheExtension to "upper")}
set TheName to text 1 thru -((count TheExtension) + 1) of TheName
tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
repeat while it contains NewName
set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
set NewName to TheName & Divider & Counter & TheExtension
end repeat
end tell
return NewName
end GetUniqueName
to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
displays a dialog for multiple item edit (note that a return is used between each edit item)
for each of the items in SomeItems, a line containing it's text is placed in the edit box
the number of items returned are padded or truncated to match the number of items in SomeItems
parameters - SomeItems [list]: a list of text items to edit
TheTitle [boolean/text]: use a default or the given dialog title
ThePrompt [boolean/text]: use a default or the given prompt text
returns [list]: a list of the edited items, or {} if error
set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
if TheCount is less than 1 then return {} -- error
if ThePrompt is in {true, false} then -- "with" or "without" Prompt
if ThePrompt then
set ThePrompt to "Edit the following items:" & return -- default
else
set ThePrompt to ""
end if
else -- fix up the given prompt a little
set ThePrompt to ThePrompt & return
end if
if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
set TheTitle to "Multiple Edit Dialog" -- default
else
set TheTitle to ""
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
repeat with AnItem from 1 to TheCount -- pad/truncate entered items
try
set the end of TheItems to (item AnItem of TheInput)
on error
set the end of TheItems to ""
end try
end repeat
return TheItems
end EditItems
to ReplaceText of SomeText from OldItem to NewItem
replace all occurances of OldItem with NewItem
parameters - SomeText [text]: the text containing the item(s) to change
OldItem [text]: the item to be replaced
NewItem [text]: the item to replace with
returns [text]: the text with the item(s) replaced
set SomeText to SomeText as text
if SomeText contains OldItem then
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
try
set {ItemList, AppleScript's text item delimiters} to {text items of SomeText, NewItem}
set {SomeText, AppleScript's text item delimiters} to {ItemList as text, TempTID}
on error ErrorMessage number ErrorNumber -- oops
set AppleScript's text item delimiters to TempTID
error ErrorMessage number ErrorNumber
end try
end if
return SomeText
end ReplaceText
to ChangeCase of SomeText to CaseType
changes the case or capitalization of SomeText to the specified CaseType using Python
parameters - SomeText [text]: the text to change
CaseType [text]: the type of case desired:
"upper" = all uppercase text
"lower" = all lowercase text
"title" = uppercase character at start of each word, otherwise lowercase
"capitalize" = capitalize the first character of the text, otherwise lowercase
returns [text]: the changed text
set SomeText to SomeText as text
if CaseType is not in {"upper", "lower", "title", "capitalize"} then return SomeText
return (do shell script "/usr/bin/python -c \"import sys; print unicode(sys.argv[1], 'utf8')." & CaseType & "().encode('utf8')\" " & quoted form of SomeText)
end ChangeCase
</pre>
Edit: how does the choose from list dialog handle those big strings? I'm guessing not very well - is that why you avoided using them?
Message was edited by: red_menace -
Problem tyring to communicate with flash
I have a hidden DHTML layer that contains a flash movie. I
have an href link that makes the layer visible. I want the href
link to also tell the flash movie to start playing.
I installed the extesion "JavaScript Integration Kit for
Macromedia Flash 8, MX 2004 and MX" which contains several
javascripts for communicating with flash. I am using the js
function "FDK_goToFrame()" to start the movie, however I can't get
it to work. My swf was built in Flash CS3, ActionsScript 2. Does
anyone know if the Integration Kit still works for new swf files?
Is there some AS code that needs to be added to the flash file for
these scripts to work? The documentation is rather sketchy.shockbyte wrote:
> I have a hidden DHTML layer that contains a flash movie.
I have an href link
> that makes the layer visible. I want the href link to
also tell the flash movie
> to start playing.
Is there some extension you are using to accomplish this? If
not, then I'd suggest that you ask your question in the Dreamweaver
General forum where you may get someone that has run into this
issue:
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=12&catid=189&entercat= y
Or you may want to try the Flash forums to see if some Flash
folks know about it:
http://www.adobe.com/cfusion/webforums/forum/index.cfm?forumid=15
Danilo Celic
|
http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert -
URGENT: Flash Remoting problem in onStatus event with Flash Player 8
I'm having a problem that only occurs in Flash Player 8 and
above.
When I publish to Player 8, my Connection.onStatus fires
to function correctly. The problem is that the status
information is undefined!
Any idea?
Thanks in advance,
Rui Pereiraconvert all mouse events to touchevents
Adobe Flash Platform * Touch, multitouch and gesture input -
2 plugin-containers appear after Recent History Cleared and with Flash disabled.
Running Firefox 4, Windows XP and Shockwave Flash 10.2.153.1
With Shockwave Flash disabled, 2 plugin-container.exe processes appear in Windows Task Manager when I clear Recent History from Firefox. Why? These processes do not go away.Clicking "Clear Recent History" in Firefox 4.0 triggers several instances of "plugin-container.exe" which can be seen in Task Manager. The memory usage is about 100MB. It sometimes takes 20-30 seconds for the CRH box to disappear as the computer whirs away in obvious distress.
System info:
WinXP Home Edition, SP3, 32-bit
Firefox 4.0
Firefox add-ons: NoScript, AdBlock Plus, CookieCuller -
Problem moving files using applescript/folder action setup.
I'm wanting files to move to certain folders depending on what the first letter of the file name. Here is what I have so far. If the file starts with TF715SH it should move to Serenity:Color Images for Monthly:T
property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer.
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
repeat with this_item in added_items
if this_item starts with "M" then
move this_item to "Serenity:Color Images for Monthly:M:" with replacing
end if
if this_item starts with "N" then
move this_item to "Serenity:Color Images for Monthly:N:" with replacing
end if
if this_item starts with "T" then
move this_item to "Serenity:Color Images for Monthly:T:" with replacing
end if
end repeat
end tell
end try
end adding folder items toHi,
Because the class of this_item is a alias wich contains the full path of the file :
You need to get the file name, also you must use the term "folder" before the string "Serenity:Color Images for Monthly:M:", otherwise the Finder will return an error.
if (name of this_item) starts with "M" then
move this_item to folder "Serenity:Color Images for Monthly:M:" with replacing
end if
Here's another way to do this :
on adding folder items to this_folder after receiving added_items
tell application "Finder"
set colorImgFolder to folder "Serenity:Color Images for Monthly:"
repeat with this_item in added_items
set c to first character of (get name of this_item)
considering case -- case sensitive
if c is in "MNT" then move this_item to folder c of colorImgFolder with replacing
end considering
end repeat
end tell
end adding folder items to -
Problem restoring files and settings after a recovery
I did a system recovery using recovery disks purchased from HP. My files and settings were backed up during the recovery program on an external drive.
There were no instructions included on restoring files and settings after the system recovery. I called HP and a support tech told me to run the backup program on the external drive from the admin profile which I did. However, the program put my old files on my C drive at the following location C:\System Recovery Files\C\Users\Bill.
How do I use these files under my current user profile at C:\Users\Bill?
I suppose I could move my data files, folder by folder, but is there an easier and better way?
My computer is as follows:
HP Pavilion GC673AAR-ABA m8100n, SN MX3733051W
Windows Vista Home Premium 32-bit
This question was solved.
View Solution.Unfortunately the backup feature within the recovery manager is used as a last resort option for gathering whatever files can be saved, and there is no way to place the files back to where they were previously.
I am an HP employee, but my views are my own and are not endorsed by HP. -
New to Applets: Problems wiht writing to files and with scroll panes.
Hi, I've recently graduated from university and so I have limited experience in java programming and I'm having some trouble with JApplets (this is the first time I've made one). I'm trying to make a simple program that will allow users to pick one of a few background images from a list (a list of jpanels within a scroll pane) then at the click of a button will output a CSS with the background tag set to the image location. This is for use on a microsoft sharepoint site where each user has a My-Sit area which I want to be customizable.
So far I've been creating this program as an application rather than a JApplet and just having another class that extends the JApplet Class which then displays the JFrame from the GUI Class. This initially didnt work because I was trying to add a window to a container so I kept programming it as an application until I got it working before trying to convert it to a JApplet. I solved the previous problem by changing my GUI class to extend JPanel instead of JFrame and it now displays correctly but with a coupe of issues.
Firstly the applet will not create/write to the CSS file. I read that applets couldnt read/write to the users file system but they could to their own. The file I wish to write to is kept on the same machine as the applet so I'm not sure why this isn't working.
Secondly the scroll panel is no longer working properly. This worked fine when I was still running the program as an application when the GUI still extended JFrame instead of JPanel (incidentally the program no longer runs as an application in this state) but now the scroll bar does not appear. This is a problem since I want the applet to remain the same size on the page even if I decide to add more backgrounds to the list. I tried setting the applet height/width to smaller values in the html file to see if the scroll bar would appear if the area was smaller than the GUI should be, but this just meant the bottom off the applet was cut off.
Could anyone offer any suggestion as to why these thigns arnt working and how to fix them? If necessary I can post my source code here. Thanks in advance.Ok, well my program is made up of 4 classes, I hope this isnt too much to be posting. If any explaination is needed then I'll post that next. Theres lots of print lines scattered aroudn due to me trying to fix this and theres some stuff commented out from when the program used to be an application isntead of an applet.
GUI Class, this was the main class until I made a JApplet Class
public class AppletGUI extends JPanel{
*GUI Components*
//JFrames
JFrame mainGUIFrame = new JFrame();
JFrame changeBackgroundFrame = new JFrame();
//JPanels (Sub-panels are indented)
JPanel changeBackgroundJP = new JPanel(new BorderLayout());
JPanel changeBackgroundBottomJP = new JPanel(new GridLayout(1,2));
JPanel backgroundJP = new JPanel(new GridLayout(1,2));
JPanel selectBackground = new JPanel(new GridLayout(1,2));
//Jbuttons
JButton changeBackgroundJB = new JButton("Change Background");
JButton defaultStyleJB = new JButton("Reset Style");
//JLabels
JLabel changeBackgroundJL = new JLabel("Choose a Background from the Menu");
JLabel backgroundJL = new JLabel();
//JScrollPane
JScrollPane backgroundList = new JScrollPane();
JPanel backgroundListPanel = new JPanel(new GridLayout());
//Action Listeners
ButtonListener bttnLstnr = new ButtonListener();
//Controllers
CSSGenerator cssGenerator = new CSSGenerator();
Backgrounds backgroundsController = new Backgrounds();
backgroundMouseListener bgMouseListener = new backgroundMouseListener();
//Flags
Component selectedComponent = null;
*Colour Changer*
//this method is used to change the colour of a selected JP
//selected JPs have their background darkered and when a
//different JP is selected the previously seleced JP has its
//colour changed back to it's original.
public void changeColour(JPanel theJPanel, boolean isDarker){
//set selected JP to a different colour
Color tempColor = theJPanel.getBackground();
if(isDarker){
tempColor = tempColor.darker();
else{
tempColor = tempColor.brighter();
theJPanel.setBackground(tempColor);
//also find any sub-JPs and change their colour to match
int j = theJPanel.getComponents().length;
for(int i = 0; i < j; i++){
String componentType = theJPanel.getComponent(i).getClass().getSimpleName();
if(componentType.equals("JPanel")){
theJPanel.getComponent(i).setBackground(tempColor);
*Populating the GUI*
//backgroundList.add();
//Populating the Backgrounds List
*Set Component Size Method*
public void setComponentSize(Component component, int width, int height){
Dimension tempSize = new Dimension(width, height);
component.setSize(tempSize);
component.setMinimumSize(tempSize);
component.setPreferredSize(tempSize);
component.setMaximumSize(tempSize);
*Constructor*
public AppletGUI() {
//REMOVED CODE
//AppletGUI.setDefaultLookAndFeelDecorated(true);
//Component Sizes
//setComponentSize
//Adding Action Listeners to Components
System.out.println("adding actions listeners to components");
changeBackgroundJB.addActionListener(bttnLstnr);
defaultStyleJB.addActionListener(bttnLstnr);
//Populating the Change Background Menu
System.out.println("Populating the window");
backgroundsController.populateBackgroundsData();
backgroundsController.populateBackgroundsList();
//loops to add background panels to the JSP
ArrayList<JPanel> tempBackgroundsList = new ArrayList<JPanel>();
JPanel tempBGJP = new JPanel();
tempBackgroundsList = backgroundsController.getBackgroundsList();
int j = tempBackgroundsList.size();
JPanel backgroundListPanel = new JPanel(new GridLayout(j,1));
for(int i = 0; i < j; i++){
tempBGJP = tempBackgroundsList.get(i);
System.out.println("Adding to the JSP: " + tempBGJP.getName());
//Add Mouse Listener
tempBGJP.addMouseListener(bgMouseListener);
backgroundListPanel.add(tempBGJP, i);
//set viewpoing
backgroundList.setViewportView(backgroundListPanel);
/*TESTING
System.out.println("\n\n TESTING!\n Printing Content of SCROLL PANE \n");
j = tempBackgroundsList.size();
for(int i = 0; i < j; i++){
System.out.println(backgroundList.getComponent(i).getName());
changeBackgroundJP.add(changeBackgroundJL, BorderLayout.NORTH);
changeBackgroundJP.add(backgroundList, BorderLayout.CENTER);
//changeBackgroundJP.add(tempBGJP, BorderLayout.CENTER);
changeBackgroundJP.add(changeBackgroundBottomJP, BorderLayout.SOUTH);
changeBackgroundBottomJP.add(changeBackgroundJB);
changeBackgroundBottomJP.add(defaultStyleJB);
System.out.println("Finsihed populating");
//REMOVED CODE
//adding the Background Menu to the GUI and settign the GUI options
//AppletGUI.setDefaultLookAndFeelDecorated(true);
//this.setResizable(true);
//this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocation(500,500);
this.setSize(400,300);
this.add(changeBackgroundJP);
//REMOVED CODE
*Main Method*
public static void main(String[] args){
System.out.println("Creating GUI");
AppletGUI theGUI = new AppletGUI();
theGUI.setVisible(true);
System.out.println("GUI Displayed");
*Button Listener Inner Class*
public class ButtonListener implements ActionListener{
//check which button is clicked
public void actionPerformed(ActionEvent event) {
AbstractButton theButton = (AbstractButton)event.getSource();
//Default Style Button
if(theButton == defaultStyleJB){
System.out.println("Default Style Button Clicked!");
//Change Background Button
if(theButton == changeBackgroundJB){
System.out.println("Change Background Button Clicked!");
String backgroundURL = cssGenerator.getBackground();
if(backgroundURL != ""){
cssGenerator.setBackgroundChanged(true);
cssGenerator.setBackground(backgroundURL);
cssGenerator.outputCSSFile();
System.out.println("Backgroudn Changed, CSS File Written");
else{
System.out.println("No Background Selected");
*Mouse Listener Inner Class*
public class backgroundMouseListener implements MouseListener{
public void mouseClicked(MouseEvent e){
//get component
JPanel tempBackgroundJP = new JPanel();
tempBackgroundJP = (JPanel)e.getComponent();
System.out.println("Background Panel Clicked");
//change component colour
if(selectedComponent == null){
selectedComponent = tempBackgroundJP;
else{
changeColour((JPanel)selectedComponent, false);
selectedComponent = tempBackgroundJP;
changeColour((JPanel)selectedComponent, true);
//set background URL
cssGenerator.setBackground(tempBackgroundJP.getName());
public void mousePressed(MouseEvent e){
public void mouseReleased(MouseEvent e){
public void mouseEntered(MouseEvent e){
public void mouseExited(MouseEvent e){
}JApplet Class, this is what I plugged the GUI into after I made the change from Application to JApplet.
public class AppletTest extends JApplet{
public void init() {
System.out.println("Creating GUI");
AppletGUI theGUI = new AppletGUI();
theGUI.setVisible(true);
Container content = getContentPane();
content.setBackground(Color.white);
content.setLayout(new FlowLayout());
content.add(theGUI);
AppletGUI theGUI = new AppletGUI();
theGUI.setVisible(true);
setContentPane(theGUI);
System.out.println("GUI Displayed");
public static void main(String[] args){
AppletTest at = new AppletTest();
at.init();
at.start();
}The CSS Generator Class. This exists because once I have the basic program working I intend to expand upon it and add multiple tabs to the GUI, each one allowing the user to change different style options. Each style option to be changed will be changed wit ha different method in this class.
public class CSSGenerator {
//Variables
String background = "";
ArrayList<String> backgroundCSS;
//Flags
boolean backgroundChanged = false;
//Sets and Gets
//For Variables
public void setBackground(String theBackground){
background = theBackground;
public String getBackground(){
return background;
//For Flags
public void setBackgroundChanged(boolean isBackgroundChanged){
backgroundChanged = isBackgroundChanged;
public boolean getBackgroundChanged(){
return backgroundChanged;
//background generator
public ArrayList<String> backgroundGenerator(String backgroundURL){
//get the URL for the background
backgroundURL = background;
//creat a new array list of strings
ArrayList<String> backgroundCSS = new ArrayList<String>();
//add the strings for the background options to the array list
backgroundCSS.add("body");
backgroundCSS.add("{");
backgroundCSS.add("background-image: url(" + backgroundURL + ");");
backgroundCSS.add("background-color: #ff0000");
backgroundCSS.add("}");
return backgroundCSS;
//Write CSS to File
public void outputCSSFile(){
try{
//Create CSS file
System.out.print("creating file");
FileWriter cssWriter = new FileWriter("C:/Documents and Settings/Gwilym/My Documents/Applet Data/CustomStyle.css");
System.out.print("file created");
System.out.print("creating buffered writer");
BufferedWriter out = new BufferedWriter(cssWriter);
System.out.print("buffered writer created");
//check which settings have been changed
//check background flag
if(getBackgroundChanged() == true){
System.out.print("retrieving arraylist");
ArrayList<String> tempBGOptions = backgroundGenerator(getBackground());
System.out.print("arraylist retrieved");
int j = tempBGOptions.size();
for(int i = 0; i < j ; i++){
System.out.print("writing to the file");
out.write(tempBGOptions.get(i));
out.newLine();
System.out.print("written to the file");
out.close();
}catch (Exception e){//Catch exception if any
System.out.println("Error: Failed to write CSS file");
/** Creates a new instance of CSSGenerator */
public CSSGenerator() {
}The Backgrounds Class. This class exists because I didnt want there to just be a hardcoded lsit of backgrounds, I wanted it to be possible to add new ones to the list without simply lettign users upload their own images (since the intended users are kids and this sharepoint site is used for educational purposes, I dont want them uplaoded inapropraite backgrounds) but I do want the site admin to be able to add more images to the list. for this reason the backgrounds are taken from a list in a text file that will be stored in the same location as the applet, the file specifies the background name, where it is stored, and where a thumbnail image is stored.
public class Backgrounds {
//Array Lists
private ArrayList<JPanel> backgroundsList;
private ArrayList<String> backgroundsData;
//Set And Get Methods
public ArrayList getBackgroundsList(){
return backgroundsList;
//ArrayList Population Methods
public void populateBackgroundsData(){
//decalre the input streams and create a new fiel hat points to the BackgroundsData file
File backgroundsDataFile = new File("C:/Documents and Settings/Gwilym/My Documents/Applet Data/BackgroundsData.txt");
FileInputStream backgroundsFIS = null;
BufferedInputStream backgroundsBIS = null;
DataInputStream backgroundsDIS = null;
try {
backgroundsFIS = new FileInputStream(backgroundsDataFile);
backgroundsBIS = new BufferedInputStream(backgroundsFIS);
backgroundsDIS = new DataInputStream(backgroundsBIS);
backgroundsData = new ArrayList<String>();
String inputtedData = null;
//loops until it reaches the end of the file
while (backgroundsDIS.available() != 0) {
//reads in the data to be stored in an array list
inputtedData = backgroundsDIS.readLine();
backgroundsData.add(inputtedData);
//TESTING
System.out.println("\n\nTESTING: populateBackgroundsData()");
int j = backgroundsData.size();
for(int i = 0; i < j; i++){
System.out.println("Index " + i + " = " + backgroundsData.get(i));
System.out.println("\n\n");
//close all stremas
backgroundsFIS.close();
backgroundsBIS.close();
backgroundsDIS.close();
} catch (FileNotFoundException e) {
System.out.println("Error: File Not Found");
} catch (IOException e) {
System.out.println("Error: IO Exception Thrown");
public void populateBackgroundsList(){
backgroundsList = new ArrayList<JPanel>();
int j = backgroundsData.size();
System.out.println("number of backgrounds = " + j);
backgroundsList = new ArrayList<JPanel>();
for(int i = 0; i < j; i++){
String tempBackgroundData = backgroundsData.get(i);
JPanel backgroundJP = new JPanel(new GridLayout(1,2));
JLabel backgroundNameJL = new JLabel();
JLabel backgroundIconJL = new JLabel();
//split the string string and egt the background name and URL
String[] splitBGData = tempBackgroundData.split(",");
String backgroundName = splitBGData[0];
String backgroundURL = splitBGData[1];
String backgroundIcon = splitBGData[2];
System.out.println("\nbackgroundName = " + backgroundName);
System.out.println("\nbackgroundURL = " + backgroundURL);
System.out.println("\nbackgroundIcon = " + backgroundIcon + "\n");
backgroundNameJL.setText(backgroundName);
backgroundIconJL.setIcon(new javax.swing.ImageIcon(backgroundIcon));
backgroundJP.add(backgroundNameJL);
backgroundJP.add(backgroundIconJL);
backgroundJP.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
//Name the JP as the background URL so it can be found
//May be useful sicne the data file may need to contain 3 fields in future
//this is incase the preview image (icon) is different from the acctual background
//most liekly in the case of more complex ppictures rather then repeating patterns
backgroundJP.setName(backgroundURL);
//Add the JP to the Array List
backgroundsList.add(backgroundJP);
//TESTING
System.out.println("\n\nTESTING: populateBackgroundsList()");
j = backgroundsList.size();
for(int i = 0; i < j; i++){
System.out.println("Index " + i + " = " + backgroundsList.get(i));
System.out.println("\n\n");
}So thats my program so far, if theres anythign that needs clarifying then please jsut ask. Thank you very much for the help! -
Problems with writing to file, and with ActionListener.
I have been trying to write a Payroll Division type program as my school Computer Science Project. However, I have a few problems with it...
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.*;
public class Personnel implements ActionListener {
JFrame GUIFrame;
JLabel ID, Line, OKText,AnswerField;
JTextField IDField, LineField;
JButton OK;
JPanel GUIPanel;
int trialCounter=0;
final static int employeeNumber = 7;
final static int maxValue = ((employeeNumber*4)-1);
//Number of employees, which would be in real life passed by the Payroll division.
public static String [][] sortHelp = new String [employeeNumber+1][3]; /** Creates a new instance of Personnel */
public Personnel() {
GUIFrame = new JFrame("PersonnelSoft"); //create title header.
GUIFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GUIFrame.setSize(new Dimension(100, 140));
GUIPanel= new JPanel(new GridLayout(2, 2));
addWidgets();
GUIFrame.getRootPane().setDefaultButton(OK);
GUIFrame.getContentPane().add(GUIPanel, BorderLayout.CENTER);
GUIFrame.pack();
GUIFrame.getContentPane().setVisible(true);
GUIFrame.setVisible(true);
private void addWidgets() {
ID = new JLabel ("Please enter your employee Identification Number:", SwingConstants.LEFT);
IDField = new JTextField ("ID", 5);
Line = new JLabel ("Please enter the line of your payroll with which you have concerns:", SwingConstants.LEFT);
LineField = new JTextField ("###", 2);
OKText = new JLabel ("Click OK when you have verified the validity of your request", SwingConstants.LEFT);
OK = new JButton ("OK");
OK.setVerticalTextPosition(AbstractButton.CENTER);
OK.setMnemonic(KeyEvent.VK_I);
AnswerField = new JLabel("The Result of your Querie will go here", SwingConstants.LEFT);
GUIPanel.add(ID);
GUIPanel.add(IDField);
GUIPanel.add(Line);
GUIPanel.add(LineField);
GUIPanel.add(OKText);
GUIPanel.add(OK);
GUIPanel.add(AnswerField);
OK.addActionListener(this);
ID.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
OKText.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
Line.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
public static void ArrayCreate() throws IOException {
//creates a employeeNumber x 3 array, which will hold all data neccessary for future sorting by employee ID number.
int counter = 2;
int empCounter = 1;
String save;
//avoid having to waste memory calculating this value every time the for loop begins
FileInputStream inFile = new FileInputStream("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(inFile));
String line;
line = in.readLine();
StringTokenizer st = new StringTokenizer(line);
save = st.nextToken();
sortHelp[0][0] = save;
sortHelp[0][2] = save;
while (st.hasMoreTokens()) {
save = st.nextToken();
sortHelp[0][1] = save;
while (counter <= maxValue) {
line = in.readLine();
if (((counter - 1) % 4) == 0) {
st = new StringTokenizer(line);
sortHelp[empCounter][0] = st.nextToken();
sortHelp[empCounter][2] = sortHelp[empCounter][0];
while (st.hasMoreTokens()) {
save = st.nextToken();
sortHelp[empCounter][1] = save;
empCounter++;
counter++;
public static String[] joinString() {
String[] tempStorage = new String[employeeNumber+1];
int counter;
for (counter = 0; counter <= employeeNumber; counter++) {
tempStorage[counter] = (sortHelp[counter][1] + sortHelp[counter][0]);
return (tempStorage);
public static String[] sortEm(String[] array, int len)
java.util.Arrays.sort(array);
return array;
public static void splitString(String[] splitString){
int counter;
for (counter = 0; counter <= employeeNumber; counter++){
sortHelp[counter][0]=splitString[counter].substring( 5 );
sortHelp[counter][1]=splitString[counter].substring(0,5);
void setLabel(String newText) {
AnswerField.setText(newText);
void writetoHR(String local) throws IOException {
FileOutputStream outFile = new FileOutputStream ("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR2.txt");
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outFile));
out.write(local+"the preceding employee number is not in our database, but has submitted a request. Please sort out the issue");
System.exit(0);
public void actionPerformed(ActionEvent e){
boolean flag=false;
String local=IDField.getText();
int i=0;
while((i<=employeeNumber)&&(flag==false)){
if (sortHelp[1]==local) {
flag=true;
i++;
trialCounter++;
if (trialCounter>=3)
writetoHR(local);
if (flag==false)
setLabel("Your ID number does not exist in our records. Verify your ID and try again.");
else {
switch (LineField.getText())
case 04:
setLabel("Your pay is calculated by multiplying your working hours by the amount per hour. If both of these fields are satisfactory to you, please contact humanresource");
break;
case 03:
setLabel("Hourly amount was calculated by the system, by dividing your yearly pay 26 and then 80.");
break;
case 07:
setLabel("Overtime pay was calculated by multiplying regular hourly pay by 1.1");
break;
case 06:
setLabel("The overtime hourly pay was multiplied by the amount of overtime hours.");
break;
case 10:
setLabel("For holiday hours, your pay is increased by 25%.");
break;
case 09:
setLabel("The holiday hourly pay was multiplied by your amount of holiday hours.");
break;
case 11:
setLabel("Your total pay was calculated by adding all the separate types of payment to your name.");
break;
case 17:
setLabel("Your net pay was found by subtracting the amount withheld from your account");
break;
case 19:
setLabel("Your sick hours remaining were taken from a pool of 96 hours.");
break;
default:
setLabel("Please contact humanresource.");
break;
private static void CreateAndShowGUI() {
JFrame.setDefaultLookAndFeelDecorated(true);
Personnel GUI = new Personnel();
public static void main(String[] args) throws IOException {
String[] temporary = new String[employeeNumber];
ArrayCreate();
temporary = joinString();
temporary = sortEm(temporary, employeeNumber);
splitString(temporary);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
CreateAndShowGUI();
int row;
int column;
for (row = 0; row < (employeeNumber); row++) { // verify proper output by ArrayCreate splitString
for (column = 0; column <= 2; column++) {
System.out.print(sortHelp[row][column]);
System.out.print(' ');
System.out.print(' ');
System.out.println();
1) It does not permit me to switch on a String. How do I solve that?
2)How would I throw an exception (IO) within actionperformed?
3)Generally, if cut it down to everything except the writing to a file part, the actionperformed script causes an error... why?
Thanks in advance.
And sorry for the relative lameness of my question...
---abe---Thank you very much. That did solve almost all the problems that I had...
I just have one more problem.
First (here's the new code):
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
import javax.swing.*;
import java.util.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.*;
public class Personnel implements ActionListener {
JFrame GUIFrame;
JLabel ID, Line, OKText,AnswerField;
JTextField IDField, LineField;
JButton OK;
JPanel GUIPanel;
int trialCounter=0;
final static int employeeNumber = 7;
final static int maxValue = ((employeeNumber*4)-1);
public static String [][] sortHelp = new String [employeeNumber+1][3];
public Personnel() {
GUIFrame = new JFrame("PersonnelSoft"); //create title header.
GUIFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GUIFrame.setSize(new Dimension(100, 140));
GUIPanel= new JPanel(new GridLayout(2, 2));
addWidgets();
GUIFrame.getRootPane().setDefaultButton(OK);
GUIFrame.getContentPane().add(GUIPanel, BorderLayout.CENTER);
GUIFrame.pack();
GUIFrame.getContentPane().setVisible(true);
GUIFrame.setVisible(true);
private void addWidgets() {
ID = new JLabel ("Please enter your employee Identification Number:", SwingConstants.LEFT);
IDField = new JTextField ("ID", 5);
Line = new JLabel ("Please enter the line of your payroll with which you have concerns:", SwingConstants.LEFT);
LineField = new JTextField ("###", 2);
OKText = new JLabel ("Click OK when you have verified the validity of your request", SwingConstants.LEFT);
OK = new JButton ("OK");
OK.setVerticalTextPosition(AbstractButton.CENTER);
OK.setMnemonic(KeyEvent.VK_I);
AnswerField = new JLabel("The Result of your Querie will go here", SwingConstants.LEFT);
GUIPanel.add(ID);
GUIPanel.add(IDField);
GUIPanel.add(Line);
GUIPanel.add(LineField);
GUIPanel.add(OKText);
GUIPanel.add(OK);
GUIPanel.add(AnswerField);
OK.addActionListener(this);
ID.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
OKText.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
Line.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
public static void ArrayCreate() throws IOException {
int counter = 2;
int empCounter = 1;
String save;
FileInputStream inFile = new FileInputStream("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(inFile));
String line;
line = in.readLine();
StringTokenizer st = new StringTokenizer(line);
save = st.nextToken();
sortHelp[0][0] = save;
sortHelp[0][2] = save;
while (st.hasMoreTokens()) {
save = st.nextToken();
sortHelp[0][1] = save;
while (counter <= maxValue) {
line = in.readLine();
if (((counter - 1) % 4) == 0) {
st = new StringTokenizer(line);
sortHelp[empCounter][0] = st.nextToken();
sortHelp[empCounter][2] = sortHelp[empCounter][0];
while (st.hasMoreTokens()) {
save = st.nextToken();
sortHelp[empCounter][1] = save;
empCounter++;
counter++;
public static String[] joinString() {
String[] tempStorage = new String[employeeNumber+1];
int counter;
for (counter = 0; counter <= employeeNumber; counter++) {
tempStorage[counter] = (sortHelp[counter][1] + sortHelp[counter][0]);
return (tempStorage);
public static String[] sortEm(String[] array, int len)
java.util.Arrays.sort(array);
return array;
public static void splitString(String[] splitString){
int counter;
for (counter = 0; counter <= employeeNumber; counter++){
sortHelp[counter][0]=splitString[counter].substring( 5 );
sortHelp[counter][1]=splitString[counter].substring(0,5);
void setLabel(String newText) {
AnswerField.setText(newText);
void writetoHR(String local) throws IOException {
FileOutputStream outFile = new FileOutputStream ("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR2.txt");
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outFile));
out.write(local+"the preceding employee number is not in our database, but has submitted a request. Please sort out the issue");
System.exit(0);
public void actionPerformed(ActionEvent e){
boolean flag=false;
String local=IDField.getText();
local trim();
int i=0;
while((i<employeeNumber)&&(flag==false)){
if (sortHelp[1]==local) {
flag=true;
else {
i++;
trialCounter++;
if (trialCounter>=3)
try {
writetoHR(local);
} catch (IOException exception) {
setLabel("We are sorry. The program has encountered an unexpected error and must now close");
} finally {
if (flag==false)
setLabel("Your ID number does not exist in our records. Verify your ID and try again.");
else {
final Map m = new HashMap();
m.put("04","Your pay is calculated by multiplying your working hours by the amount per hour. If both of these fields are satisfactory to you, please contact humanresource.");
m.put("03", "Hourly amount was calculated by the system, by dividing your yearly pay 26 and then 80.");
m.put("07", "Overtime pay was calculated by multiplying regular hourly pay by 1.1");
m.put("06", "The overtime hourly pay was multiplied by the amount of overtime hours.");
m.put("10", "For holiday hours, your pay is increased by 25%.");
m.put("09", "The holiday hourly pay was multiplied by your amount of holiday hours.");
m.put("11", "Your total pay was calculated by adding all the separate types of payment to your name.");
m.put("17", "Your net pay was found by subtracting the amount withheld from your account.");
m.put("19", "Your sick hours remaining were taken from a pool of 96 hours.");
setLabel(m.get(LineField.getText()));
private static void CreateAndShowGUI() {
JFrame.setDefaultLookAndFeelDecorated(true);
Personnel GUI = new Personnel();
public static void main(String[] args) throws IOException {
String[] temporary = new String[employeeNumber];
ArrayCreate();
temporary = joinString();
temporary = sortEm(temporary, employeeNumber);
splitString(temporary);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
CreateAndShowGUI();
int row;
int column;
for (row = 0; row < (employeeNumber); row++) { // verify proper output by ArrayCreate splitString
for (column = 0; column <= 2; column++) {
System.out.print(sortHelp[row][column]);
System.out.print(' ');
System.out.print(' ');
System.out.println();
Now that code above produces two errors. First of all.
local trim();produces the error:
Syntax error, insert "AssignmentOperator ArrayInitializer" to complete ArrayInitializerAssignementSecondly, if I take that into comments, the line
setLabel(m.get(LineField.getText()));Produces the error:
The method setLabel(String) in the type Personnel is not applicable for the arguments (Object)If anybody could help me solve these, I would be sincerely thankfull.
Now, before anybody asks as to why I want to trim the String in the first place, it is due to the fact that I compare it to another String that is without whitespaces. Thus the field that DOES have whitespaces was preventing me from launching into the if loop:
if (sortHelp[1]==local) {
flag=true;
(within actionperformed) Or at least that's my explanation as to why the loop never launched. If it is wrong, can somebody please explain?)
I apologize for the horrible indentation and lack of comments. This is an unfinished version.. I'll be adding the comments last (won't that be a joy), as well as looking for things to cut down on and make the program more efficient.
Anyways,
Thanks in Advance,
---abe--- -
Problem ContourHD files 720p60fps with FCP 7
Hi,
Sorry for my english but I send this message from France.
I bought a Contour HD 1080p for my outdoor sports sessions.
I record with this cam in the Action Settings. The format of the files is .mov, Ambarella AVC encoder, 1280x720, AAC stereo 48 Khz, 59.94 IPS.
I try to import these files to FCP 7 but it did not recognize the files.Does someone have already this problem ?
What can I do to resolve it ?
Many thanks for your help
FredSounds like a variation of AVCHD. Do they open in Quicktime? If so, you can try opening it in Compressor and converting to ProRes.
-
Threading problem during File Upload with Apache faces upload tag
First I am going to tell you "My Understanding of how JSF Apache Upload works, Correct me if i am wrong".
1) Restores View (to show Input box and Browse button to facilitate users to select a file for upload)
2) Translates Request Parameters to Component Values (Creates equivalent components to update them with request values).
3) Validates Input(Checks to see whether the User has input the correct file)
4) Updates Backing Bean or Model to reflect the values.
5) Renders response to user.
I am uploading huge files of sizes 400MB and above with the help of JSF apache extensions tag
<h:form id="uploadForm" enctype="multipart/form-data">
<x:inputFileUpload style="height:20px;" id="upload" value="#{backingbean.fileContents}" storage="file" size="50" />
</h:form>
In the backing bean
private UploadedFile fileContents;
public UploadedFile getFileContents() {
return fileContents;
public void setFileContents(UploadedFile fileContents) {
System.out.println("File being uploaded...");
this.fileContents = fileContents;
Since, the file size is so huge, I am using temp folder to use for the apache tag instead of memory.
In web.xml i am using like this
<filter>
<filter-name>ExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>600m</param-value>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>10m</param-value>
</init-param>
<init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/uploadfolder/</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ExtensionsFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
The upload process is working perfectly fine.
Now coming to the problem:
Suppose one user is logging into the application & uploading say 400MB of files.
Until these files are linked to the model objects as my understanding of step 2, if second user tries to open the application he gets stuck with the loading page.
The page gets loaded only after the request files are linked to the component values(Step 2 above) and updates the backing bean's values.
I don't see any error in the logs. User is getting stuck. The user is getting stuck only when uploading the files. The other operations like searching are not blocking any other activities performed by the user.
Server used: IBM Application Server V6.0. CPU is normal, memory usage is normal.Dear friend,
i am also trying to upload using the common file upload.
when try to run the file error is coming
can give some suggestion.
can i use if concurrent user file upload at a time
Maybe you are looking for
-
Preview doesn't work anymore after update to Lion
Preview doesn't work anymore after update to Lion. I cannot start it from dock nor from the programm folder. I always get a (very) long error message. Anyone else with this problem? Process: Preview [207] Path: /Applications/Previe
-
How to set fill, stroke & color to a group
First of all, I must say I'm a complete beginner in Javascript so please have patience with me. What I'm trying to do is to set a lot of groups to specific fill, stroke & color using a function. var docRef = app.activeDocument; var Reg = docRef.swatc
-
Front Row Displays all my vids as "Movies"
I want my Music Videos to be filed under "Music Videos" and my TV Shows under "TV Shows" and my Movies under "Movies" and my Podcasts under "Podcasts"... why do all my vids (no matter what they are) show up under movies? The only things that catagori
-
Hi, we set up a Web AS with several server nodes for development. Each developer of our team is (logically) associated with one server node. So we want to ensure that all developers can debug their part of the application without interferring with a
-
Wait for event Node - (ParForEach index 000000)
Hi all, I have a wait event and my work flow resulted in error at this node with the (ParForEach index 000000) error.. what might be the problem.. Thanks in advance, Sethu