Problem with file and tabbedpanes

Hi
i am reading a file on my program .in that file i am written 4lines .but i want that from that file 2 lines on one tab and another two lines on another tab using tabbedpanes
Edited by: nirmala on Dec 26, 2007 7:26 AM

i am written some code see this public void actionPerformed(ActionEvent e) {
// Handle open button action.
if (e.getSource() == browse) {
int returnVal = fc.showOpenDialog(NnsClient.this);
if (returnVal == JFileChooser.APPROVE_OPTION ) {
File file = fc.getSelectedFile();
// This is where a real application would open the file.
log.setText(file.getParent());
} else {
log.setText("Open command cancelled by user." + newline);
log.setCaretPosition(log.getDocument().getLength());
// Handle update button action.
} else if (e.getSource() == update) {
File file = fc.getSelectedFile();
String val = file.getAbsolutePath();
File file1 = new File (val);
try
RandomAccessFile ra = new RandomAccessFile(file1,"r");
//System.out.println(ra);
long last = ra.length();
System.out.println(last);
FileReader fis = new FileReader (file1);
//LineNumberReader lr = new LineNumberReader(fis);
//System.out.println(lr);
//lr.skip(last);
//int countRec = lr.getLineNumber()-1;
//System.out.println(countRec);
BufferedReader bis = new BufferedReader(fis);
StringBuffer sb = new StringBuffer();
String line = null;
while((line= bis.readLine())!=null)
     //int i = line.length();
     System.out.print(line.toString());
     //System.out.println(line);
     //sb.append(line);
System.out.println(sb.append(line));
     sb.append("\n");
tf.setText(sb.toString());
ra.close();
fis.close();
//dis.close();
bis.close();
catch(FileNotFoundException e2)
e2.printStackTrace();
catch(IOException e1)
e1.printStackTrace();
}this is for action performed in this code only i want to develop that when i click on update i wanto get the file data on different tabs
JTabbedPane tp = new JTabbedPane();
JPanel pa = new JPanel();
pa.add(scroll);
//pa.add(ns.ta.setText(sb.toString()));
JPanel pb = new JPanel();
pb.add(tf);
t.setEditable(false);
//setPrefferedSize(new Dimension(30,40));
//tf.setText(sb.toString());
tp.addTab("tab1", pb);
tp.addTab("tab2",pa);
content.add(tp,BorderLayout.SOUTH);this code is for tabbedpanes on my program

Similar Messages

  • Problem with file and printer sharing

    I just installed a Linksys WRT54G to replace a D-Link wireless router and cannot reestablish my file and printer sharing since replacing the router.  I had file and printer sharing working fine before installing the WRT54G.   All of the computers are running either XP Pro or 2000 Pro.  I have two printers attached to one of my computers that I was previously sharing with all of the other computers on our home network.  One is attached via a parallel port, the other via a USB port.  
    Here's what I've tried so far without success.
    1.  The IP of the WRT54G is 192.168.1.1, and the IP's it assigns to my LAN computers begin 192.168.1.XXX.  The old IP of the D-Link was 192.168.0.1 and its LAN IPs were 192.168.0.XXX, so I've gone into my firewall and changed the settings for the range of trusted computers to correspond to the WRT54G's IP addresses.
    2.   I've tried uninstalling the printers and reinstalling them, including reinitializing printer sharing.
    3.  When I try to use the Windows  "Add printer" wizard to add a networked printer, it can see the computer that has the printers attached, but it does not see the printers.
    4.  I haven't fooled around with the file sharing settings, but they've all be lost too, so I suspect there is a common problem for both printer and file sharing.
    Any suggestions would be most welcome.  I don't know what would be different about the WRT54G that would cause this problem.

    Try this to Enable File and Printer Sharing...Turn Off the Router Firewall...Make sure the Windows Firewall is also Off...

  • Problems with files and a new hard drive...

    Hi there...
    I have maxed out an external hard drive I was using to hold all my photos....
    I have bought a 2 new drives with a view to backing up everything I have on file.
    If I start moving files around LR then can not locate the files and they come up in red in the folders section of the programme.
    IS there a way of reorganizing things without having to re import stuff?
    Any help would be great....
    Lee

    I think I get it... (im having a dumb day!!)
    I set the new h/d up and I import in essence an empty file into LR.
    Then all the files I want to keep on the new h/d I drag and drop from the old h/d...is this right??
    like I said Im having a dumb day...
    all the help is much appreciated
    Lee

  • Problem with File and his methods

    Is there a way to know how much Files there is in a File.
    MyFile contain MySubFile1 MySubFile2 and what i want my program to do is to return the number 2 (for my two subfiles).

    File repracine = new File("namedir") ;
    String[] tabfile ;
    if (!repracine.exists())
    repracine.mkdir() ;
    tabfile = repracine.list() ;
    for (int i=0;i<tabfile.length();i++)
    System.out.println(tabfile) ;
    problem: tabfile.length()...
    Small changes have to be done..
    1. length is not a method but an attribute of the array. That means that> for (int i=0;i<tabfile.length();i++) has to be for (int i=0;i<tabfile.length;i++)2. If you want just the number of files in your directory You don't need the for loop at all. All you need is the tabfile.length value. If you need to print the names of all the files in the directory then you better change line:>    System.out.println(tabfile) ; to >    System.out.println(tabfile) ;
    Hope that helped.
    afotoglidis

  • Problem with DMGs and error: "No Mountable File Systems"

    Problem with DMGs and error: "No Mountable File Systems"
    The files are not corrupt. The problem is occurring with all DMGs that are apparently formatted in MS-DOS FAT16. No the file will not mount with Disk utility or any other disk mounter programs I have found.
    This is now the second time this occurred and now effects my MBP and my iMac. First time i spent days with Apple support and the only solution was ultimately back up the data, reformat the HD, start over from scratch and reload everything. That lasted about a month before the problem resurfaced and is now an issue on both iMac and MBP.
    I tried to identify all the programs I installed immediately before the error, as I am convinced it is the result of a software conflict.
    Recent programs includes:
    1) upgrading from Parallels 5.5 to 6.0 on both machines.
    2) using an HP secure II usb drive and setting up a secure disk.
    3) installing new itunes 10
    4) new update to Flip For Mac.
    The files affected are downloaded dmgs, including personal brain and google earth, both which are formatted in FAT16.
    Any help or thoughts? Apple has now spent hours trying and they say i now have to reformat and wipe and start over. That is unacceptable and based on pasted experience the problem is likely to repeat itself. having to wipe and rebuild a HD ever month is not an solution. i need to fid the root problem.
    In the meantime, anyone got a real solution on how to extract the data for a DMG using a different method?
    Message was edited by: remaia

    Where you able to find the solution, i am having the same problem, all was fine till i install some programs only same one i saw did we both did was flip4mac i uninstalled it but the problem is still there, i also restored and erased the hardrive but im not up to doing that all over again. If you found anything out let me know i would greatly appreciate it

  • Problem with Preview and PSD files - random gray square

    Hi guys, hope you can help...
    I've got a problem with Preview and PSD files.
    If I open in Preview both an original jpg straight from my reflex and the photoshop version of the same picture, the psd file presents a gray square (of what it seems unrendered image) in a random area of the photo (sometimes in the center.). The square is quite big...
    If I zoom in or zoom out it disappears...if I scroll to another photo and then back to the psd, the square it's there again...sometimes in a different position.
    I've tried the same psd on my older iMac with leopard...and got no problem at all.
    I suspect it got something to do with my Ati...
    (this is the second iMac 27...the first went back for gray banding on the lcd screen and flickering and yellow tinge........)
    Thanks for your help.
    DAve.

    maybe I'm onto something...
    I've just found out that opening Preview in 32bit mode (instead of default 64bit) works flawlessly with any psd files. If I switch back to 64bit mode, Preview is much faster but the gray square comes back...
    It seems like the i7 is much faster than the Ati....
    Any more realistic ideas?

  • Problem with Jabber and file transfers WAN - LAN-Users - a solution!

    Hi,
    I read a lot of messages about problems with file transfers between iChat-Users, if one (or both) are behind a NAT.
    I had this problem to and found an easy solution:
    My situation
    iChat-Server behind a Netgear ProSafe FireWall. I opened the needed Ports including Port 7777 (the Port for the iChat-proxy (proxy65).
    The iChat-Server is configured to host the domain "server.ourdomain.com" (as an example).
    This address can be reached from the LAN and also from the WAN-side.
    From the LAN-side the DNS redirects to 192.168.1.1, from the WAN this domain redirects to our official IP-address (the WAN-IP of the FireWall).
    I tried nearly all kinds of mentioned solutions, but nothing helped.
    The really easy solution is: I just added our official IP to the "Hosted Domains" in the iChat-section of Server-Admin.
    After that change, the transfers are made via the proxy65 of iChat-Server. The transfers are shown in the log /private/var/jabberd/log/proxy65.log.
    I think, that the other posters who also have this kind of problem are working in a similar setup (domain name of server is used from the LAN AND the WAN-side with different IP-addresses (LAN-IP & WAN-IP).
    This solution will only work, if the WAN-IP is a fixed address.
    svenc

    Until the introduction of file promises in AIR Athena, it  has never been possible to drag remote files out of an AIR application.
    You could refer to the http://www.adobe.com/devnet/air/flex/articles/using_file_promises.html
    Hope this is helpful. Please let me know if I could help more.

  • Unable to download from AppStore, updates,etc.Messages 'the installer is damaged' to 'there might be a problem with file ownership and permissions.' I am the owner and only user of a new MBP. What could be going on?

    Is anyone having the same type of problems I'm having with Lion. I have a new MacBook Pro, received 7 weeks ago, preinstalled with Leopard 10.6.7. I didn't migrate anything from my old iMac, wanted a clean install from the Apple Store. While there, I asked for the upgrade to Lion 10.7, however their system was down.
    I  installed it myself, wirelessly about a week later, and Apple emailed me a receipt. Now, I've had to call support directly last week when I lost Mail, Address Book, was unable to open Preview or iTunes, among other problems. Seemed fixed after a session that baffled even the store tech.  Now I am unable to download or install the recent Mac updates for Lion, from the App Store, could not install Adobe Reader, etc. Messages range from 'A network error has occured - Check your Internet connection and try again' to 'The Installer is damaged and cannot open the package. There may be a problem with file ownership or permissions.'  All fail and I'll probably have to call Apple again. I am frustrated beyond words.  Logs 'Install's runner tool is not properly configured as a setuid tool', domain errors, 'attempt to write a readonly database, and on and on. I have barely done a thing on this computer except search online for help with these problems. Safari gives me a 'You are not connected to the internet' too often. Diagnostics disagrees. I do see wi-fi problems in the forum. Disk and permissions were fine at the beginning of the earlier problems, checked first by support tech. I'm not sure if support tech even knew. I was just happy they were fixed. Anyone have these download and/or install problems after a 'clean bill of health' so to speak, only a week ago?

    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Problems with "File Open" and "File Save As" in Tiger

    I recently upgraded to OS10.4.3 on my PowerBook G4 and ever since I have had only frustration upon frustration with this new version.
    When launching a program whether it be QuarkXpress 6.5, Illustrator CS, Photoshop CS, InDesign CS or Acrobat 6.0 and you go "File Open", it can take up to 3 minutes before the "Open" window dialog box will appear so that you can access your files. The same applies to the first "File Save As" in any of these programs. After that everything works normally.
    Has anyone experienced this problem with Tiger and is there a solution? I should be most grateful for any assistance.
    Leon
    PowerBook G4   Mac OS X (10.4.3)  

    I got so frustrated with iDisk that I did indeed turn mine off altogether. Now I just mount it when I need it, and do whatever I want to do manually. And it is STILL annoyingly slow, not only in its own operations, but in the way it hijacks the Finder and can sometimes bring all Finder operations to a grinding halt.
    I keep a local copy of the all the files I have on my iDisk in a perfectly normal folder. And I keep looking forward to the day when the promised seamless operation of my local files and iDisk will actually work.
    I've been waiting for several years and thru several different incarnations of the OS, and it ain't there yet. I think Apple's version of WebDAV is just really really bad. I've heard other WebDAV servers work better. And I figured it was a bad sign when, back in Panther, one of Apple's own helpers recommended a third party WebDAV software (Goliath) to access the servers rather than using the Finder. I didn't think things could get any worse--until Tiger came along. A bad situation can get worse, and it did.
    Maybe when Leopard gets here.....
    Francine
    Schwieder

  • I am not able to download ITunes. I had some problems with ITunes and had to uninstall but now when I reinstall iTunes after I click on download iTunes and save the File, I get this message"Thank you for downloading iTunes" and nothing else happens. I don

    I had some problems with ITunes and had to uninstall but now when I reinstall iTunes after I click on download iTunes and save the File, I get this message"Thank you for downloading iTunes" and nothing else happens. I don't see any thing else. Now not sure what else I have to do.
    Thanks,
    Ranjit

    See the further information area of Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Problems with outlook and address book contacts: my outlook contacts had around 3,000 entries. Outlook duplicated by itself and now outlook and address book have each over 340,000. What should I do?

    Problems with outlook and address book contacts: my outlook contacts had around 3,000 entries. Outlook duplicated entries and have now 340,000. I reinstalled microsoft office and, thus, outlook, and reinstalled mac OS X system and applications. While I managed to delete outlook contacts so that I can re-sync with my blackberry, the contacts at Mac Address Book were not deleted and still have over 340,000 entries. I do not mind deleting all contacts since I have back up, but I have not been able to delete them. Also, when I go at Address Book and try to delete or merge duplicated entries, the system takes forever and never ends because of such large amount of entries. Worse, when I do so I run out of RAM memory.
    My Macbook pro is just 2 months old.
    What should I do? Is there a way to delete my Mac Address Book without having the problem above?
    Many thanks
    Regis

    zlatan24 wrote:
    For solving out troubles connected with corrupted or lost address book you may use address book recovery. It owns various features such as restoring wab files, it working under any Windows OS. The utility has modern and easy to use interface due to almost every experienced users.
    If it is a windows problem it's not going to run on the OP's MacBook Pro

  • Problems with Safari and Firefox (HTTP?)

    Problems with Safari and Firefox (HTTP?)
    On a laptop G4, 10.5.8 and Safari 5.02 I experience the following:
    On the account of my oldest daughter everything works fine, i.e. wireless internet works and no problems with mail or safari.
    On the same laptop, on the account of my other daughter, the wireless is OK, she can mail etc. But safari nor firefox works. It says: can’t find server (whatever site) and in the activity window it looks if safari tries to open files (in the safari preferences-folder) in stead of http. Same applies to Firefox, so maybe it has more to do with HTTP in general?
    What goes wrong? What to do? I tried the following on the host terminal (tips from Apple)
    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
    and
    defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
    but that did not help,
    Nanne

    I'm still wondering why it happens now at this moment in time...
    PC does seem to be a bit odd & inconsistent, the few times I've tested with it, at least so far as we content filtering goes; and if I remember rightly, you're not the first to report previously ok settings suddenly preventing some or all internet until pc is switched off altogether.
    It may work when re-enabled

  • Problems with File Transfers Over Firewire 800

    Problems with File Transfers Over Firewire 800.
    Over the past month, I have had problems when transfering files from my harddrive, over Firewire 800 to a portable drive. I usually transfer very large files (20gb or more) to the portable drives for moving files around. When I drag a file over to copy onto a drive, the transfer starts normally. If I drag more files to copy over, the computer screen goes darker and a large icon comes up that looks like a power button icon. It tells me to restart, so I have to do a hard shut down on my G5. Weird. I also get the dark screen of death sometimes when I am transfering those large files and open another application to do some work while it's copying. It's killing me. I am having to sit here and wait for the transfer to finish before I can do anything.
    Any thoughts...
    Dual 2.7 GHz PowerPC G5
    Mac OSX 10.4.3
    Dual 2.7 GHz PowerPC G5   Mac OS X (10.4.3)  

    Have you run the Apple Hardware Test? Sounds like it could be a RAM problem.

  • Problem with Rescue and Recovery after installing Norton Internet Security 2010

    Hi all.
    It's my first time in this forum.
    I have a problem, with Rescue and Recovery, after installing Norton Internet Security 2010 on my T43.
    The message I get it:
    "Rescue and Recovery is unable to back up the file 'C:\Documents and settings\all Users\Application Data\ Norton\ 00000082\00000109\000003c1\cltMLS1.bat' Because the file is either corrupted or being used by another application. Please close any application that could be using the file.
    I tried to close the Norton but I couldn't find how.
    Tanks
    Doron71

    Hi and welcome to the forum,
    the reason for this situation is, that the antivir files are protected from being modified.
    This is the reason, why this file cannot be backed up. I assume, that you would get much more such messages, as there are surelly multiple files files, that are protected like this.
    So the solution is to block folders from being archived. Please start RnR application and in the configuration set this folder as the excluded one.
    This will skip the backup of this file and will fix your situation.
    Please let me know, if you have covered this.
    Cheers

  • Problem with ECS and XSD

    Hi B2B Gurus,
    We are facing the problem with ECS and XSD files from past 2 weeks, Steps we followed
    1. Created a ECS file in document editor version 11g: 6.6.0
    2. ECS files consists only from ST and SE segments
    Ex: ST
    BCH
    CUR
    REF
    PER -- Exclude
    TAX -- Exclude
    SE
    3: Generated a XSD file from ECS file( File --> export---> Oracle B2B) in document ediotr
    4. We imported a ECS and XSD file in B2B console( documents---docdef-transaction set ECS file) and XSD File
    5. We tested one file from manually we face below error:
    Error Code B2B-51507
    Error Description Machine Info: (usmtnz-dinfap19.dev.emrsn.org) Description: Payload validation error.
    Error Level ERROR_LEVEL_COLLABORATION
    Error Severity ERROR
    Error Text
    and some times it shows Guideline load Error or simply Error
    Please help us to resolve this
    Regards

    Anuj,
    We are sending the EDI XML file from backend, then B2B will convert it into EDI file, How can we analyze EDI XML file with ECS file, B2B is not converting to EDI.
    1. Can we use 10g ECS file and XSD file in 11G
    2. I tried to import it, but it showing below error while doing testing
    App Message property     {MSG_ID=90422086, Sequencing=false, DOCTYPE_REVISION=5020, MSG_TYPE=1, FROM_PARTY=EMERSON, DOCTYPE_NAME=850, TO_PARTY=APLL, ATTACHMENT=}
    Direction     OUTBOUND
    State     MSG_ERROR
    Error Code     B2B-51507
    Error Text     Error Brief : The element does not include any significant data.
    Error Description     Error : The Element PER02 does not include any significant data characters. Segment PER is defined in the guideline at position 3600.{br}{br}This error was detected at:{br}{tab}Segment Count: 11{br}{tab}Element Count: 2{br}{tab}Characters: 5395 through 5397
    Created Date     06/20/2011 02:52 PM
    Modified Date     06/20/2011 02:52 PM
    Note: I used the same files in 10G its working fine.
    Regards
    Edited by: Francis on Jun 20, 2011 10:48 AM

Maybe you are looking for

  • Indesign server web service - where is the support to upload a file with the script and download the result?

    Hi, I am working on a POC that is supposed to convert indd files to pdf (i.e. using of course the indesign server). Basically I want to call the IDS Web Service (located on a different machine perhaps), pass in the input file, the conversion script a

  • BPC Script Logic - XDIM_FILTER results in error

    I am writing a Script Logic in BPC and I need it to include all records where the DESTINATION dimension member has the Dimension Property of PLANDEST = "Y" This approach works: *SELECT(%DestinationMbrs%,"[ID]","Destination","[PlanDest] = 'Y'") *XDIM_

  • Open in wrong drive and/or getting stuck during startup

    Please help! My Mac OS X (10.4.11) has two drives: one for normal use and one for backup. For some reason my Mac keeps opening up in the backup drive. I go to System Preferences and click on Startup disk, and tell it to restart in the main drive, and

  • Knowledge on ES workspace and Service Registry

    Hi All, I am a webdynpro for java developer. Recently I installed CE 7 1 EHP1. where I got ESR as well. Kindly, provide me some information on ESR, and what is Service repository, how I can use them in NWDS CE 7 1 EHP1. Regards, Devender  V

  • Clean install question.

    I've just got a MacBook Air and obviously with a 128GB SSD space is tight, I'm thinking of doing a clean install of OS X and leaving on the printer drives and other languages apart from English to save a few gig. Am I right in thinking if I plug a pr