My thread is ceated but doesn't have desired effect. Help?
Basically I have a jDesktopPane wiith many jInternalFrames. I need each one to be its own thread so if one locks up the whole program doesn't crash. Right now it all works fine, but if you run a method on a huge file in a jInternalFrame it'll lock the whole program up. Using netbeans I can tell that I am indeed creating a thread. I think. ok here's some code- (yes I know its not the simple, compilable, blah blah blah thing. Its 12 java files, I'm not making an example program)
getCurFrame();
new Thread(SimpleJavaEditor.ifArr[SimpleJavaEditor.curFrame]=new NewJInternalFrame(SimpleJavaEditor.curFrame,jFileChooser1.getSelectedFile())).start();
SimpleJavaEditor.jDesktopPane1.add(SimpleJavaEditor.ifArr[SimpleJavaEditor.curFrame]);
public class NewJInternalFrame extends javax.swing.JInternalFrame implements Runnable, InternalFrameListener, ActionListener, KeyListener, MouseListener {
@Override
public void run() {
initComponents();
requestFocus();
jTextPane1.getDocument().addUndoableEditListener(
new UndoableEditListener() {
public void undoableEditHappened(UndoableEditEvent e) {
if(e.getEdit().isSignificant()){
undoManager.addEdit(e.getEdit());
jScrollPane1.getVerticalScrollBar().addAdjustmentListener(new java.awt.event.AdjustmentListener() {
public void adjustmentValueChanged(AdjustmentEvent e) {
if(jScrollPane1.getVerticalScrollBar().getValue()<=jScrollPane2.getVerticalScrollBar().getValue()){
jScrollPane2.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getValue());
}else{
jScrollPane2.getVerticalScrollBar().setValue(jScrollPane2.getVerticalScrollBar().getMaximum());
jScrollPane2.getVerticalScrollBar().addAdjustmentListener(new java.awt.event.AdjustmentListener() {
public void adjustmentValueChanged(AdjustmentEvent e) {
if(jScrollPane2.getVerticalScrollBar().getValue()<=jScrollPane1.getVerticalScrollBar().getValue()){
jScrollPane1.getVerticalScrollBar().setValue(jScrollPane2.getVerticalScrollBar().getValue());
}else{
jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
FontMetrics fm = jTextPane1.getFontMetrics(jTextPane1.getFont());
int charWidth = fm.charWidth( 'w' );
int tabWidth = charWidth * 3;
TabStop[] tabs = new TabStop[10];
for (int j=0;j<tabs.length;j++){
int tab = j + 1;
tabs[j] = new TabStop(tab*tabWidth);
TabSet tabSet = new TabSet(tabs);
SimpleAttributeSet attributes = new SimpleAttributeSet();
StyleConstants.setTabSet(attributes, tabSet);
int length = jTextPane1.getDocument().getLength();
jTextPane1.getStyledDocument().setParagraphAttributes(0, length, attributes, true);
length = jTextPane2.getDocument().getLength();
jTextPane2.getStyledDocument().setParagraphAttributes(0, length, attributes, true);
keyWord();
public NewJInternalFrame(int Frame,File fileA) {
frame=Frame;
file=fileA;
}I think that should be enough. Ask if you need more code.
Thanks
Edited by: ghostbust555 on Dec 23, 2009 12:57 PM
ghostbust555 wrote:
ok here's some code- (yes I know its not the simple, compilable, blah blah blah thing. Its 12 java files, I'm not making an example program)That's your prerogative, but you have to note that we won't put a shred more effort into fixing your problem than you do. And since you aren't making the effort to make an example program, we probably won't go to much effort to help.
That said, I didn't read your code since it wasn't simple or compilable, but it sounds like you need to do your logic on a separate thread. Try looking at SwingWorker.
Similar Messages
-
Network Link Conditioner installed successfully but doesn't have an effect
Hi community,
i installed Network Link Conditioner while Mountain Lion has been Beta.
I see the Network Link Conditioner Pane in my Preferences but if i turn on the effect with the toggle nothing happens. I setup a no connectivity profile to test it and Safari, my own application i want test and the iPhone simulator as well are able to open web pages.
It seems, that the version i had installed has no effect on the network stack?
However, i downloaded the latest version but im unable to uninstall the Network Link Conditioner.
If you have any suggestions i would be happy to know them.
I don't want to reinstall my system just for setting up Network Link Conditioner but i really need it for testing purposes.I had the same problem but it was my mistake that I downloaded the "Network LInk Conditioner" of Mountain Lion where as i am usling Lion OSX . Actually in https://developer.apple.com/downloads/index.action , there are two links for download and there is specified the OS also . I checked and download again for Lion and it isworking fine .
-
my iphone keeps shuting down and now refuses to turn back on, it comes up with the message to plug into itunes but this doesnt help?! i dont know what i should do? is it beyond repair help please
JasmineHill1 wrote:
my iphone keeps shuting down and now refuses to turn back on, it comes up with the message to plug into itunes ...
See Here > http://support.apple.com/kb/HT1808
You may need to try this More than Once...
Be sure to Follow ALL the Steps...
But... if the Device has been Modified... this will Not necessarily work. -
Loadjava doesn't have desired effect
I am deploying an application tp Oracle 8.1.7 database on a Windows 2000 PC . The app makes use of the OracleXMLQuery class which is provided in xsu12.jar (I am using java1.22).
When deploying I get a resolve error stating that oracle/xml/sql/query/... is not found. When I query all_objects table I don't see any oracle/xml/sql/query classes at all. I do however see them from jdev's database browser???
I have run
"loadjava -f -r -u sys/password -g PUBLIC xsu12.jar" and could see the output stating that classes were being created. However when I go back and do a select:
select status, owner, object_name from all_objects where object_type='JAVA CLASS' and object_name like 'oracle/xml/sql%'
I see absolutely none of my files - any ideas?Colin,
You may have a bad jvm install on your 817 dataserver.
SELECTcount(*)
FROM dba_objects
WHERE object_type LIKE '%JAVA%'
<< should return approx. 10k object count>>
SELECT dbms_java.longname(name)
FROM sys.obj$
WHERE type# = 29 andstatus != 1
should be 0 ...
If not..suggest you file an iTAR with OSS
regards,
Steve
Oracle Sr. Tech Analyst -
Hi, can you help me for my payment account? It's always show " Your payment method was declined..." How can I fix it? There's only 3 to choose fpr Visa, Master Card and Amex.. But doesn't have "None".. I can't download any apps from app store
http://support.apple.com/kb/ht1918
-
Hi, how to fix "Payment Method Declined"? There's only Visa, Amex, Mastercard. But doesn't have NONE.. :(
This Apple support article may be informative:
http://support.apple.com/kb/ts5366
Regards. -
I have several times tried to stop following a thread in the PDF's forum about security issues and i still keep getting flooded with emails from this thread. I used the action within the thread that says stop following but appears to have no effect I still keep getting from 5 to 20 emails daily. Please help!!!!!!!
This may be helpful: How do I disable email notifications?
-
Hi, i bought new pc and install win 7 , icloud . I turned on but doesn't have sync with photo stream to my pc. In the old pc i had no problem , can you help me?
I installed the new version of i cloud and its work ok
-
My ipod touch 3g turns on but doesn't have any icons. What do I do?
My ipod touch 3g turns on, has the display picture, but doesn't have any icons. What do I do? No safari, music, videos, app store, itunes, no apps at all! I've tried restoring it, but it tells me "the ipod could not be restored. This device isn't eligible for the requested build". It won't let me do anything. Goes back to the empty screen and search. HELP!!!
The Apple article listed at the bottom of this post states:
Cannot be restored. This device is not eligible for the requested build: If you receive this error, you likely do not have the latest version of iTunes installed. Check http://www.apple.com/itunes/download/ for the latest available version of iTunes. If you do have the latest version of iTunes, this can occur when you attempt to restore using an older .ipsw file. Try restoring in a new user to ensure that iTunes downloads a new IPSW. Downgrading to a previous version is not supported.
From:
http://support.apple.com/kb/TS1275 -
The sliders in Lightroom worked fine for several months with my Sony NEX3N but now they have no effect. I can only edit photos by changing the histogram directly.
The sliders in Lightroom worked fine for several months with my Sony NEX3N but now they have no effect. I can only edit photos by changing the histogram directly.
-
I need oracle patch but doesn't have login user
i'm a student at some indonesian university, for my last task i need the patch for oracle 9i where i can get it?
someone have told me to look at metalink.oracle.com
but i don't have any user to login
because i don't buy the product
i need this product for educational purpose...
so i doesn't have money to buy this product today
some one please help me
thanksAn additional note to Kappys is make sure it is a Full retail version and not one for a specific computer that may not work.
-
Problem correlates exactly with the Java update time per event viewer! Problem is starting to gain traction as more users experience same! Can’t determine how to fix? Maybe an error in the Java update?
I have also been having this problem, starting today, although my Firefox doesn't crash/close when the error box pops up - I can just close the box and carry on browsing.
However, as with the person in the thread listed above, I found that disabling McAfee SiteAdvisor seems to stop it happening (it happened fairly at random, but in about half an hour of browsing with it disabled, I haven't had the error pop up, compared to within a few minutes when SiteAdvisor is enabled). It looks like there was also a SiteAdvisor update today, so that also correlates with the onset of this problem. Are other people getting this problem using SiteAdvisor? I don't know much about the mechanics of SiteAdvisor - could there be a link with Java too?
Using Firefox 27.0, Windows 7 SP1, McAfee SiteAdvisor 3.6.5, Java 10.45.2.18. -
SOLVED: kernel loads, but doesn't have a root file system
Hi,
The system is an Asus X202E. It does UEFI and has a GPT partition system. I've gotten through that part. And it is clear to me that the kernel loads.
It's the next step that's giving me grief. I've tried this with two bootloaders: gummiboot and rEFInd.
With gummiboot, the kernel panics because it can't mount the root file system. With rEFInd, it gets to the intial ramdisk and then drops me to a shell, apparently because the root file system is set to null, and it obviously can't mount that as "real root".
Here is what I posted on the Arch mailing list, documenting that I have indeed specified the correct root (I'm copying this from the email, eliding the unfortunate line wraps):
bridge-live# cat /boot/loader/entries/arch.conf
Title Arch Linux
linux /vmlinuz-linux
initrc /initramfs-linux.img
options root=PARTUUID=d5bb2ad1-9e7d-4c75-b9b6-04865dd77782
bridge-live# ls -l /dev/disk/by-partuuid
total 0
lrwxrwxrwx 1 root root 10 Apr 15 19:26 0ab4d458-cd09-4bfb-a447-5f5fa66332e2 -> ../../sda6
lrwxrwxrwx 1 root root 10 Apr 15 19:26 3e12caeb-1424-451c-898e-a4ff05eab48d -> ../../sda7
lrwxrwxrwx 1 root root 10 Apr 15 19:26 432a977b-f26d-4e75-b9ee-bf610ee6f4a4 -> ../../sda3
lrwxrwxrwx 1 root root 10 Apr 15 19:26 95a1d2c2-393a-4150-bbd2-d8e7179e7f8a -> ../../sda2
lrwxrwxrwx 1 root root 10 Apr 15 19:26 a4b797d9-0868-4bd1-a92d-f244639039f5 -> ../../sda4
lrwxrwxrwx 1 root root 10 Apr 15 19:26 d5bb2ad1-9e7d-4c75-b9b6-04865dd77782 -> ../../sda8
lrwxrwxrwx 1 root root 10 Apr 15 19:26 ed04135b-bd79-4c7c-b3b5-b0f9c2fe6826 -> ../../sda1
lrwxrwxrwx 1 root root 10 Apr 15 19:26 f64f82a7-8f2b-4748-88b1-7b0c61e71c70 -> ../../sda5
The root partition is supposed to be /dev/sda8, that is:
lrwxrwxrwx 1 root root 10 Apr 15 19:26 d5bb2ad1-9e7d-4c75-b9b6-04865dd77782 -> ../../sda8
So the correct PARTUUID followed by the one I have specified in
arch.conf is:
d5bb2ad1-9e7d-4c75-b9b6-04865dd77782
d5bb2ad1-9e7d-4c75-b9b6-04865dd77782
I'm guessing that this is really the same problem with both gummiboot and with rEFInd, but don't really know. It's clear to me that the initrd is not being correctly constructed. So I removed /etc/mkinitcpio.conf and did, as per the Arch wiki,
pacman -Syyu mkinitcpio linux udev
No joy.
I don't even know which way to go at this point. If I even knew how to tell it where the real disk is in the initial ram disk shell, that would help. Better of course, would be actually solving the problem.
Thanks!
Last edited by n4rky (2013-04-17 21:41:36)I have made extremely limited progress on this issue.
My previous attempt to specify the root partition in mkinitcpio.conf was insufficient. Furthermore, this is no place--despite the documentation--for the orthodoxy about using UUIDs rather than the straight /dev/sdx. In my case:
root=/dev/sda8
and run
mkinitcpio -p linux
It still drops me into the shell at boot. I can do
mount /dev/sda8 /new_root/
and exit the shell. It still won't believe it has the root device and drops me back in. I just exit.
At this point, for a very brief moment, things look promising. It appears to be starting normally. Then, gdm.service, NetworkManager.service, and dbus.service all fail to start. There may be others but the screen goes by too quickly. At this point, it hangs trying to initialize the pacman keyring and all I can do is CTRL-ALT-DEL.
It occurred to me that this might extend to the rEFInd configuration and so I modified it to also use /dev/sda8 rather than the UUID, but this made no difference. Trying to boot via gummiboot still yields the previously specified kernel panic. -
I just upgraded to Firefox 5. Before when I filled in a form, I just had to click autofill and all my information was provided. I found autofill on customize toolbars and added it, but it only had my name and address, not my credit cards or passwords. Before I could click on them and change them if I needed to. I would like to input them on this version or import them from the last one so I can easily fill forms online, but I can't see how to do it.
See https://support.mozilla.com/en-US/questions/822354#answer-185784
-
How to delete one of your photo albums but doesn't have a red thing
I went on my friend's computer to download my pictures from my pervious phone, I noticed that the pictures came up twice in 2 different albums. It won't allow me to delete on or both of the albums. Also when I take a picture it goes into a third album "Camera Roll". What do I do?
Hello,
This should help.
http://support.apple.com/kb/HT4236
Under the section on "To delete photos and videos from your device."
When you sync photos from a computer, the only way to remove the photos is through the computer again.
If the photos were inside of a folder, they would be inside an album named after that folder, and you would also have another album named "Photo Library"
Camera roll is, as roaminggnome mentioned, where your photos and videos go that you take on the device. These can be deleted freely on the phone with no issue. Only photos that were moved from a computer will need to be removed through iTunes.
Hope this helps!
Maybe you are looking for
-
Multiple directory locations in Sender File adapter
Hi All, I have a scenario where my single adapter needs to poll from 7 different directory locations. Is it posible to configure all seven sorce directory location in single sender file adapter. Regards, Xier
-
How to upload the xlf dashboard to the intranet
Hi all, I want to upload the dashboard to the intranet in order the customer can acces it directly from there. Is it possible? Can anybody tell me how can i do that? Thanks in advance, Diego
-
FM to get list of all directories and files on application server..
Hi All, Can anyone tel me FM to get list of all directories and files on application server..i know 'F4_DXFILENAME_TOPRECURSION' and '/SAPDMC/LSM_F4_SERVER_FILE' these are working too...but my requirement is when i click F4 i should get list of direc
-
How to choose which specs to get with 15 inch rMBP
I want to make the transition from a PC to my first mac and looking at the 15 inch rMBP. I just dont know which specs to consider upgrading or if the base model is the right one for me. I need a new computer for school and I am a general use computer
-
Hi, instruction for to work this script : http://www.russellbrown.com/images/tips_downloads/Adobe_Edit_in_ACR_Installer.zip please? Video with the instruction don't work