1. Not able to compile Swing files coderanch.comIt's difficult to help with no source code or error messages, but here's an idea ... Many Java books save space by omitting the import statements that are needed to locate the classes (in Java packages) used in a program. Does adding these lines at the start of your program, but AFTER the package statement, help? import javax.swing.*; import java.awt.*; import ... |
2. ResultSet to XML file coderanch.comhai friends, Now I got a requirement to produce XML files dynamically from the RESULTSET I am getting by executing some queries. But I have no idea about XML. I found some codes which is helpful to me in xml generation.But they are all static.ie predefining the required tags. Any one have some idea or sample codes. waiting for fast response. ... |
3. how to get swing application in program files coderanch.com |
4. importing a .ttf file coderanch.comi noticed that in the api there was a setFont method for JFrame. Now this is what i was wondering. Is it possible to import(by import i mean code it in) a .ttf file into the class and get it to change the font for the entire frame to the custom one i want imported. I tried to do this on ... |
5. File Navigation GUI coderanch.comGreetings I have done GUI programming in the past, but it's always been with a 3rd party code generator. So I'm kind of in new territory. I've been asked to code up a directory navigator (view files, create files, delete files) in swing. I am completely clueless as to what APIs and tools are applicable to this. This can't possibly be ... |
6. spaces in file name coderanch.comHi there, I don't know if this is the right place to post, but since I'm using Swing, I thought that many of you have came to this problem. I have a text field (or label) and there is a button that execute the file name inside this text field or label, the code is: private void cvArchivoExecButtonActionPerformed(java.awt.event.ActionEvent evt) { String ... |
7. Opening a file coderanch.comHi there! I currently have an app that a user can right click on a part number to view an image. Currently what I am doing, is creating the file path (I have a file in DB2 that ,depending on the type of part number, has the directory that the image would be located in), then appending the file name and ... |
8. how to convert (.sxi) file to (XML) coderanch.comI don't think it's going to be easy. One way would be to let OpenOffice open those files, and use its Java API to get at the contents. Another would be to unzip the .sxi file, and then read and interpret the XML files directly. (OO files are zipped XML files.) I don't know if the XML format is properly documented, ... |
9. how import ppt file in java coderanch.comHi Nathan... Your Code Work perfectly in my application, i am very happy same time Thanks to you again. same time i want some another help plz ,i want the import PPT file in my jav swing application,i seen the your previous reply POI webpage but i canot come to clear idea.i try to convert PPT file to (.sxi) and UNziped ... |
10. how to convert PPT file to XML file coderanch.com |
11. how to open and edit ppt file inside java coderanch.com |
12. problem during writing new file coderanch.comhi!!! this is gajera sanjay from v.v.nagar .india... i m working on project of steganography process but i have some problem in this after hiding my original data inside the image file ...when i am trasnsfer it to reciever /destination .. the file is transffered but at the reciever side when i extract my data byte by byte there is no ... |
13. compiling a file from the GUI coderanch.comHi, I tried the options, but it seems to execute only if the java file compiled is in the same directory. however, the compiling works. What should I do if the file is in a different folder? let's say the folder is "c:\javacodes\filetesting". how do i execute a java file that is present in this directory? Any help is appreciated. |
14. how to edit GUI file coderanch.comHow to edit the GUI java file? I download the Jigloo SWT/Swing GUI Builder. And then I edit the file using open with form editor. But it seems inconvenient to edit some files. Since I can't see the total layout when I open some swing file. And the i can't set the button in the way i want. For example, I ... |
15. Creating Swing based exe file coderanch.comhello world, i have created a desktop application in Java Swing... but everytime i need to compile and run the application to see how my program is doing... i want to know what should i do so that by double clicking on the icon on the desktop i will be able to rum the program directly without compiling again and again ... |
16. viewing all Files of a single directory coderanch.com |
17. View Files coderanch.com |
18. how can we create new log file (per day) coderanch.com |
19. Which Swing Component to Use to view log file ?? coderanch.comHello Everybody I want to view the log file in Unix OS.Normally we use tail command to view the log file contents dyanmically (as the log file changes, it shows the latest change to that log file). Basically i want to simulate the same thing with Swing component. Kindly let me know which component i can use.. more like editor where ... |
20. file explorer view in swing ? coderanch.com |
21. How to find dependant class files for java file coderanch.com |
22. Multiple files? coderanch.comI am working on a notepad like project and we have a single file that we are wanting to split up into multiple files. The problem I am having is that I cannot get parts of the program that display information into textboxes to work after I place them into a separate file. How do I get classes to reference parts ... |
23. How to create Executable files? coderanch.com |
24. Launching CHM file in Swing coderanch.comAlso I read somewhere on oracle website, that may be its not possible through Swing. If that is the case in real, then can I get some other type of Help system like JavaHelp or HLP file to work in the same manner. My basic requirement is that, the Help system should be launched from various screens. And on click of ... |
25. Reading from Logger log file coderanch.com |
26. how to zip two files in java at a time coderanch.com |
27. Creating .exe file coderanch.com |
28. Reading a .properties file from client site coderanch.com |
29. how to prevent from closing java file? coderanch.com |
30. Read RTF File from Java coderanch.com |
31. Using javalauncher to create Exe file coderanch.comHi all, I am developing application using swings. I have a thirdparty software called javalauncher. i am able to create exe file. later in my application i used jfreechart to generate graphs.To do that we need to include few jar files. Now i got a problem to generate execute file.It is saying main not found. Can anyone help me how to ... |
32. Doubt in Swing+Xml file coderanch.comHi to all... I have been used 3 GUI screens. All screens having labels and buttons. So i have 3 different xml files for GUI screens.So each screen having separate xml file.In each file there should be font name attribute. But i want there is one common xml file in order to set the font name to all the 3 screens ... |
33. How can i call a .chm file coderanch.com |
34. Beginning of the end - reading and writing to a file coderanch.comDear Ranchers, I can not understand why I am getting this exception when I read in a file. Exception:translation.Generator; translation.Generator; no valid constructor The code to write the object is below try { FileOutputStream fos = new FileOutputStream(file); ObjectOutputStream Object = new ObjectOutputStream(fos); Object.writeObject(Drawing.ZoomPanel.genpaths); Object.flush(); Object.close(); } catch(Exception ex) { System.out.println("Exception:" + ex); return false; } return true; } The code ... |
35. Saving GUI info. to files coderanch.comHi guys I appear to ba having a problem connecting my GUI with a data recorder class(vector).If i run a dos test it prints out each object within the vector however if I run it with my GUI application it fills the vector with copies of the last object entered. the record = new PersonDetails(aname,ahouse,aphone) avector.addPerson(aperson); for adding the object to ... |
36. Not able to compile Swing files coderanch.comSwing is includes in the JDK since 1.2 so it should work unless you are using a very old VM. Besides your source files do not have to be in the /bin directory. You can put them wherever you want. As long as you have your environment correctly configured for the JVM that you are using. eg. in Windows set path=c:/jdk/jdk1.4.2/bin ... |
37. How to save GUI in XML file and vice versa?? coderanch.comHello Sir: I google a good example that meets my project requirements as code below, I need to save it in XML format in disk with what I change/draw on the GUI, ie, I draw 10 lines(5 vertical and 5 horizontal) on it, then save it to MySaveLine.xml then quit, later, I open project, it read this MySaveLine.xml from disk, and ... |
38. Multiple edtiors on single file extension coderanch.comHi All, I am trying to implement this for long but getting no clue how to do it. I want to have conditional based opeing of editors when an editor is opened on a file extension. Suppose i have editors e1 and e2 and i associate the .xml file with both the editors.Now when i double click on the .xml file ... |
39. genrating java to exe file coderanch.com |
40. creating win exe file from java coderanch.com |
41. SWING - gui and xml file structure manipulation coderanch.com |
42. Get wav file reference from resource map coderanch.comOh God no! This works fine, but it is just a temporary workaround. I have a resource map in a Swing Application Framework that works perfectly with text and icons. For example in the resource file I have: myTextLabel.icon = /com/my/example/gui/resources/TextLabel.png myError.wav = /com/my/example/gui/resources/Error.wav Then in the code I have: myResourceMap = getResourceMap(); myTextLabel.setIcon(myResourceMap.getIcon("myTextLabel.icon")); But I want to use the resource ... |
43. File Downloader program coderanch.com |
44. only 'txt' files must be uploaded coderanch.com |
45. Using a xml file to store gui constants coderanch.comI am new to swing so go easy on me! I have a bunch of properties that define things like menus, options, combo boxes etc. I would like to use an xml file to load these into my gui such that new options do not require a code change. One of my problems is that I want one property to have ... |
46. java program that can run a .class file in msdos, is this possible? coderanch.comhi guys, I'm going to develop a very simple compiler for a very simple programming language (developed by my Instructor) using java just to illustrate the very basic principles of programming languages. My problem is that i don't have an idea on how a java program execute another java program or how could my program automatically open an ms-dos window and ... |
47. UI generation using xml file coderanch.comHi guys, I want to develop an application in that I have to generate a UI in Swing. In that, ui should be generated dynamically using reading XML values suppose there 4 buttons are in UI. I will write all the information about that button in xml file as length width image shape etc... my java code will read those value ... |
48. Open a file on the desktop coderanch.com |
49. Converting Swing appl. to .exe file coderanch.com |
50. Open File Function coderanch.comException in thread "AWT-EventQueue-0" java.lang.NullPointerException at l2jeditor.MainWindow.getJTextArea(MainWindow.java:78) at l2jeditor.MainWindow.loadFile(MainWindow.java:57) at l2jeditor.MainWindow.access$4(MainWindow.java:51) at l2jeditor.MainWindow$20.actionPerformed(MainWindow.java:979) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) ... |
51. problem in specifying file path coderanch.comHi In my code, i am getting the error: invalid directory,file or path name. here is my code. import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; import java.util.*; import sun.audio.*; import java.applet.*; import java.math.*; class mainframe extends JFrame implements ActionListener,Runnable { JLabel Lfilename,Lmessage,Ldesign,Ltitle; JButton Bplay,Bopen,Bsave,Bstop,Bencrypt,Bdecrypt,Bsend,Bclear; JTextArea Amessage; JTextField Tfilename; Icon Iplay,Iopen,Istop,Isave; String Ekey,Dkey,address,name; JFileChooser filechooser; File Ofilename,Sfilename,tempfilename; InetAddress ipaddress; ... |
52. How to combine these two file ? coderanch.comDoes anyone can help me combine these two file ? I have no idea how to do it.....i have tried many times ... I just want coordinate show when mouse move over image .... I have one file is browse image (image browser) and display it, another is coordinate (pos) ..... package contour; import java.awt.*; import java.io.*; import java.awt.event.*; import java.awt.MouseInfo; ... |
53. Writing RTF files from Java Swing DefaultStyledDocuments coderanch.comWriting RTF files from Java Swing DefaultStyledDocuments by Bill Stackhouse (billsdesk.java@gmail.com) May be freely reposted in its entirety. All java source contained may be freely used or modified in any products without license. Introduction Writing RTF files from Swing requires knowledge of RTF, Swing styled documents, and Swing styles. This is an attempt to pull the necessary information into a single ... |
54. what if I want to write to chooser file rather message the message2=...? coderanch.comcan you help? what if I want to write to chooser file rather message the message2? what obj type I must create? private JTextArea message = new JTextArea(40, 72); private JScrollPane jsp = new JScrollPane(message); .......................................................................................... saveJButton.addActionListener( new ActionListener() // anonymous inner class { public void actionPerformed(ActionEvent ev) { JFileChooser chooser = new JFileChooser(); if (chooser.showSaveDialog(SMTPClient.this) != JFileChooser.APPROVE_OPTION) return; File file ... |
55. Counting files in a directory coderanch.comHello, I'm just starting out on Java and am trying to modify some examples that are out there. I want to display a file table that lists the name of a directory and how many files are in that directory. Eventually I'll add a refresh button and perhaps even an option to choose the directory when it launches but right now ... |
56. Updating a file from an object (ArrayList) coderanch.comHi guys! I have a problem with updating files. Below you may see the code. I want simply insert new row in the list "userDataList". This list is stored in the file and is used to fill JTable. When new row is insterted in the list, I would like to update the file and the table (this step is skipped so ... |
57. Using regular expressions in JSGF file coderanch.comHi I am trying to make a speech UI using cloud garden' implementation of JSAPI. When the user says "Create a frame with name |
58. converting java.io.File to org.eclipse.core.resources.IFile coderanch.com |
59. problem in attached file . coderanch.comHelp me out in solving 1 error in my code: /* please run this code and try to sort out the error.*/ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.*; import java.util.Enumeration; import java.util.zip.*; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; public class Zip extends JPanel implements ActionListener { JButton button1, button2, button3; JFileChooser chooser; String ... |
60. FileFilter for excluding all files (*.*) coderanch.comI'm trying to set a JFileChooser, with an option to exclude all files (*.*) from the filter, however, I think I'm missing something out FileNameExtensionFilter filter = new FileNameExtensionFilter("Text Files", "txt"); BasicFileChooserUI.AcceptAllFileFilter exclude = new BasicFileChooserUI.AcceptAllFileFilter FileNameExtensionFilter excludeFilter = new FileNameExtensionFilter(exclude); ... chooser.setFileFilter(filter); ... Related links 1. BasicFileChooserUI 2. BasicFileChooserUI The complete code follows import javax.swing.*; import javax.swing.filechooser.*; import java.awt.*; import ... |
61. excluding files using FileFilter coderanch.compublic class TestFileChooser { } class MyFrame extends JFrame { openmenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("Text Files", "txt"); File disabledFile = new File("C:\\Documents and Settings\\Jon\\My Documents\\desktop.ini"); CustomFilter disabled = new CustomFilter("ini", "Windows Initialization Files", false); chooser.setFileFilter(filter); chooser.setFileFilter(disabled); //chooser.setAcceptAllFileFilterUser(false); if(chooser.showOpenDialog(MyFrame.this) == JFileChooser.APPROVE_OPTION) System.out.println("DEBUG: You selected this file: " + chooser.getSelectedFile().getName()); ... |
62. FileFilter() accepts if File.isDirectory() coderanch.com |
63. Connecting components in different files coderanch.comI'm developing an application with Swing and had some questions about the correct way to use actions/listeners in multiple files. I have a main GUI class with a menu bar/menu items and each menu item has an action. The actions are in their own classes. I also have a class that extends JInternalFrame to use with the application's desktop pane. When ... |
64. The Base Coding place that would export a *.exe file that gets executed anywhere in the world. coderanch.comHey dear users, am new to this forum page and am searching for some advice regarding the base coding place, like VS, netBeans, etc. that would help me in coding via Swings and other java things, make a GUI by drag and drop if possible, and then export it as a *.exe or *.jar file that doesn't show up the message, ... |
65. Create view of files in java-Swing java-forums.org |
66. save file based on file extension java-forums.orgsave file based on file extension hi everyone i am able to write a program for opening a save dialog box and give the filename with extension and click on save to save it. but when i give the file name without extension and select the file type whatever it may be it is saying that file in an ... |
67. Creating File inside a Directory java-forums.org |
68. how to develop setup file for java swinggui java-forums.orgDepending on your requirements (developing simply for Windows?), you could try a setup-file generator like InnoSetup (Yahoo/Google that). There are examples shipped with it, which should get you started quickly. However, I wasn't able to get the app (the executable jar) running out of the setup application, once the setup completed, but it works when using the Startmenu of Windows. |
69. how to make installation files using netbeans 6.5 java-forums.orgUsing NetBeans 6.5 you can create a jar file. That's the best way to distribute a Java project. If you want to create a exe file, need to use additional tools. Launch4j is one of them. But what's the point you are going to create an exe file for your application. Executable are only specific to Windows platform. |
70. How can I make the file ALWAYS save as .txt by default java-forums.orgString messageCont = outTextArea.getText(); /*create file chooser*/ final JFileChooser fc = new JFileChooser(); /*attache the file chooser to the Frame and detect OK or Cancel*/ int returnVal = fc.showSaveDialog(HanoiFrame.this); //fc.setSelectedFile(); File file = fc.getSelectedFile(); //File file = fc.setSelectedFile(new File("testing.txt")); if (returnVal == JFileChooser.APPROVE_OPTION) { try { /*if OK write the file*/ BufferedWriter output = new BufferedWriter(new FileWriter(file.getPath() + file.getName())); output.write(messageCont); output.close(); ... |
71. generate XML file from GUI Swing java-forums.org |
72. "The public type AppletFrame must be defined in its own file" what is it? java-forums.org//Create a child frame window from within an applet package Applets; import java.awt.*; import java.applet.*; import java.awt.event.*; /* * * */ class SampleFrame extends Frame{ SampleFrame(String title){ super(title); //create an object to handle window events MyWindowAdapter adapter=new MyWindowAdapter(this); //register it to receive those events addWindowListener(adapter); } public void paint(Graphics g){ g.drawString("This is in Frame window",10,40); ... |
73. how to call dll file in java program java-forums.orgThis is not a question that can be answered in one or two statements followed by a couple of lines of code. No to solve this, you're going to have to do some hard work and studying. I recommend that you Google the Java JNI library and it's various tutorials. Then start reading. See you back in a few weeks. Good ... |
74. problem communication between 2 files java-forums.orghey everyone, i've got a little problem with the communiction between files. I'm making a chat program for multiple pc's. i've got the communication and it worked, until i wanted to create a window. the window works, and there is only one problem: I cannot acces the functions on the pc that works as server. the file that holds the functions ... |
75. Load file in GUI instead of notepad java-forums.orglogdialtext = "What is the name of the file? \n(it should be located in D_MENU/files)"; textname = WelcomeMsg.showInputDialog(logdialtext); WelcomeText.setText("Opening " + textname); String editor = "gedit"; File file = new File("/home/darragh/Documenten/D_MENU/files/" + textname); boolean exist = file.exists(); if(exist) { try { Runtime.getRuntime().exec(editor + " " + file); WelcomeText.setText(textname + " Opened succesfull"); } catch (IOException ee) { WelcomeText.setText(textname + " could ... |
76. How to identify a java code file java-forums.org |
77. one file connect with another files java-forums.org:confused: Hi! I am new to java. When I develop an Application I need to open a file. that is the root file. it connected with many files. how to connected one file to many files. when I am opening the main file, the connected files only will display, don't display another files. how to develop this in swings. please help ... |
78. Import data from file into a gui java-forums.orgThere is no magic. The principle is to define a file format and then write methods to read and write files. For a simple address book, one line per entry may suffice. Separating the fields with semicolons may also work. The application will have one class of objects for entries--call int Entry; and another class for the whole collection--call it AddressBook. ... |
79. how to upload a file using swing java-forums.org |
80. Looking for Swing comonent for choosing a file java-forums.orgHi, I am working on Tablemodel and able to create the table with one column having comboboxes. Now planning to add actionlister so that i may know the value of selected item for the selected combox. But I don't have any idea. Can someone pleasehelp me. I will be really thankful to ypu. Thanks in advance. |
81. packaging files java-forums.orghey..i hav developed a swing application which can be run by double clicking the jar file i have 3 libraries (user defined) imported to the file how can i package all the files into a single jar and deploy it so that the end user will use it just by double clicking.. thnq |
82. Interaction with File System java-forums.org |
83. Generating Exe files from my project... java-forums.orgHi to all !!!. My name is Agustin and I live in Argentina... My question is the following... Is there anyway to generate an exe file from my project ?. Coz there is a friend of mine that asked me If I could do some stuff for him and I would like him to open it like a normal exe file... ... |
84. variable access from another file java-forums.org |
85. Write to File java-forums.orgI thought that if I use something like try{ FileWriter fstream = new FileWriter("outputfile.txt"); BufferedWriter out = new BufferedWriter(fstream); out.write("Hello Java"); //Close the output stream out.close(); }catch (Exception e){//Catch exception if any System.err.println("Error: " + e.getMessage()); } } Is it not true that if I add another "out.write("Hello2 Java");" line underneath the first one, it will just rewrite the whole file, ... |
86. Saving a file in a gui java-forums.orgHello I have created a GUI and need to send dll files to run a command to a machine, when the machine has run the program I would like to save the info as a text file from the info sent by the dll. Now the problems is here Dll files can only be send by c++ or jni which i ... |
87. problem !! input on GUI to a file java-forums.orgYou might want to use a FileWriter rather than a PrintWriter object. If you check the FileWriter API, you'll see that it has a constructor that takes a String for a file name and a boolean, the latter if true lets you append to a file. Again, to get more help and better help, please respond to replies and please read ... |
88. Java Logging file! java-forums.orgok, so, i want my java program to be a program, that when someone types in there username and password on the program from the computer, that it sends the username/password to a text file somewhere on a server on the inter web. so for example, if i typed Jcbonway on my username field on this program, and typed 12345678 as ... |
89. Using regular expressions in JSGF file java-forums.orgHi I am trying to make a speech UI using cloud garden' implementation of JSAPI. When the user says "Create a frame with name |
90. How to create file java-forums.org |
91. Open a selected file in treeview java-forums.orgHello I am new to JAVA and Swings , I wanted to write a code to open a folder from the hard disk in in treeview and then selecting any particular file its contents should be opened in the text area of my application . right now I am able to open the folder in treeview but it becomes visible ony ... |
92. Problems loading large numbers of files java-forums.orgthe game that I wrote uses 2 different JFrames: A title/menu Frame, and the game Frame. The title frame uses about 25 different images, most of them relatively small(Just the size needed for a button). On the game board, however, I use about 45 images, some of them larger (400 x 550 pixels). The game compiles and runs just fine. It ... |
93. How to use .txt and .doc files... java-forums.orgHi, I am creating GUI for my little game. I've made a menu bar with button game and help, button help includes two tems - Help and Readme....now i want to create a actionListener for button readme....when the player click on this button, the new window with help, readme will show up.....because i am to lazy to rewrite whole readme or ... |
94. Enable to create jnlp file java-forums.orgHi All, I am a newbie to Java Web Start & Netbeans. I have created the application in Netbeans 6.9 and am ready to deploy it via Java Web Start. The application has five JAR libraries associated with it and during the JWS install process I get the following error: ERROR: JAR resources in the JNLP file are not signed by ... |
95. Opening files using GUI java-forums.orgI'm working on this assignment for a 'bus company'. I have my main menu as bellow: Java Code: public class MainMenu { public static void main (String[] args) { JFrame mainMenu = new JFrame ("East Midlands Bus"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); mainMenu.setBounds((int) screenSize.getWidth()/2 - 370, (int) screenSize.getHeight()/2 - 300, 600, 450); // set position and size mainMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// exits on close mainMenu.setResizable(false); ... |
96. File copying and time stamp extraction(java) java-forums.orgimport java.io.*; public class CopyFile { private static void copyfile(String srFile, String dtFile){ try{ File f1 = new File(srFile); File f2 = new File(dtFile); InputStream in = new FileInputStream(f1); //For Append the file. // OutputStream out = new FileOutputStream(f2,true); //For Overwrite the file. OutputStream out = new FileOutputStream(f2); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0){ ... |
97. how do you get the file type of say a .ZIP file java-forums.orgprivate void listAllzipfiles(String folderlocation){ File folder = new File(folderlocation); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { File file = new File(listOfFiles[i].getName()); System.out.println("File " + listOfFiles[i].getName()); String MimeTypeOfFile = new MimetypesFileTypeMap().getContentType(file); System.out.println("Type " + MimeTypeOfFile); } else if (listOfFiles[i].isDirectory()) { System.out.println("Directory " + listOfFiles[i].getName()); } } |
98. I have c++ code for LUDO Game, Can anyone change it to Java file - Please help me java-forums.org03-12-2008 07:39 PM #1 Bhanu Sagar Member Join Date Mar 2008 Posts 1 Rep Power 0 I have c++ code for LUDO Game, Can anyone change it to Java file - Please help me I have c++ code for LUDO Game, Can anyone change it to Java file - Please help me The c++ code is pasted here #include |
99. File reading / writing java-forums.orgI'm very sorry if this is in the wrong forum.. if it is, if you could tell me where it belongs, I'll gladly move it. I'm creating a text file that my java program is reading and writing from. The text file stores a name, birth year, birth month, and birth day like this: Sibley,1990,9,7. My reader is as follows: Java ... |
100. How do I save a file in GUI forums.oracle.comThe error message is saying that you didn't put a semicolon at the end of the previous line. Also, you're calling nextLine() on a FileWriter for some reason. That won't work -- nextLine() is for reading lines, not writing them. You'd call some write() method (there are a bunch) or you can wrap it in a PrintWriter and calling println(). Please ... |