32,199 Topics
| |
Hello I would like to ask how to change button "Open" to "save" when iam using JFileChooser public void actionPerformed(ActionEvent e) { Object zrodlo =e.getSource(); if(zrodlo == mSave)//zapisywanie pliku { JFileChooser fc = new JFileChooser(); fc.setSelectedFile(new File(fileName)); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); FileNameExtensionFilter filter = new FileNameExtensionFilter( ".txt and .java files", "txt"); fc.setFileFilter(filter); if … | |
hi chaps, I would like to do this exercise taken from the deitel and deitel book, chap 4 exercise 4.38, in brief: "Write an application that reads a 4 digit int and encrypt it replacing each digit with the result of addin 7 to it and getting the reminder after … | |
Hi! i'm having a problem installing Egit on Eclipse. When i add the link http://download.eclipse.org/egit/updates , there are errors saying: unable to read repository at http://download.eclipse.org/egit/updates/content.xml connection to http://download.eclipse.org/egit/updates/p2.index failed did i miss something that I need to install or configure? i need your help, thanks! | |
We are given an array of 2n integers wherein each pair in this array of integers represents the year of birth and the year of death of a dinosaurs respectively. The range of valid years we want to consider is [-100000 to 2005]. For example, if the input was: -80000 … | |
hello, how do i insert an image into mysql so that i can retreive and use it i java. | |
Hi! i'm having a problem installing Egit on Eclipse. When i add the link http://download.eclipse.org/egit/updates , there are errors saying: unable to read repository at http://download.eclipse.org/egit/updates/content.xml connection to http://download.eclipse.org/egit/updates/p2.index failed did i miss something that I need to install or configure? i need your help, thanks! | |
Hi everyone I have a issue where I have written the entire program but couple little tweaks are needed for me to get the program done. I have my super class here "Pet". I have created couple objects in Main, "myRobin" , "myCow", "myBlackMamba" and passed some arguments to them. … | |
Hi there, I have opened another thread even if the program is very similar. I have modified some code I have produced earlier and now I am getting some runtime errors, and I can't quite understand why. Now, here's the code: EmployeeClass.java public class EmployeeClass{ private String firstName; private String … | |
Hi friends. What are applets in java. What are the advantages of Applets over stanalone programs. Please give me the better way to learning applets easy, because dificult to remembering. Please help me. Thanks & Regards Jasonmark Rxdrugonlinestore | |
I have tried looping through the text file but all it does is read the first line. I tried linefilereader but it still only reads the first line. int word_chooser = (int) (Math.random()*300); LineNumberReader r = new LineNumberReader(new FileReader("words.txt")); r.setLineNumber(word_chooser); word = r.readLine(); | |
i cant seem to create my java project into jar files so any one can run it. i have a folder with 10 java files and two folder and some images and music. take a look at my project files tree. its on a image. ![tree](/attachments/small/3/tree.jpg "align-right") i google it … | |
Hi there, I am having some trouble with a regex and am hoping on one of you great folks can assist me. I am very weak with regular expressions just to give you guys a heads up. Here is the text I am using a regex on: Control flow 6881 … | |
Alright so in my Data Structures class we have a program due sometime next week. I pretty much know how I'm going to do it, but I need help with one method of the program. I need a way to go through every possible order of 6 unique numbers. I … | |
package display; import java.io.File; class display { int file=0, directory=0; void list(String path) { File root = new File(path); File[] f1 = root.listFiles(); for (File S : f1) //error { if(S.isDirectory()) { list(S.getAbsolutePath());//error directory++; } else if(S.isFile()) { file++; } } } } package display; public class displaymain { public … | |
What are the advantages of interfaces in java over calsses. Please give me reply and mention interface importance in java. Thanks & Regards Jasonmark | |
hi all i want to create a download manager program that downloads programs(executable files) i search the internet but i didnot find something useful i would be greatful for any help thanks in advance | |
Hey guys!!! Just found this wonderful forum.....Thanks for the guys who run this forum.. I am an Elec. & Telecom engineer... I understand Java Programming & I have more than 90% of the concepts of core-java and good knowledge of jsp,servlets,struts....I have some basic knowledge of oracle.... I have a … | |
I wanted to read data from multiple files simultaneously but I am getting NULL error. Could anyone help in pointing out my error in the code. I am not sure if I can make arrays of FileInputStream and DataInputStream the way I have done. [CODE=Java] import java.io.*; class Count1 { … | |
So I just updated to Mac OS X 10.8 and I'm having a serious IT problem that is preventing me from compiling any code. It looks like I've installed Java 7, but its trying to access a nonfunctioning version of OpenJDK8 | |
What I want to do is to take a 2d int array and use it to create a Matrix (a class I will be defining) which will effectively wrap all the values of the 2d array together so that I can perform matrix multiplication for coordinate translation. I am rather … | |
int main() { float a,b,c; cin>>a >> b >>c; if(a<(b+c) && b < (a+c) && c< (a+b)) { cout<<"\nIt is a Triangle.”; if (a==b && b==c) cout<<"\nIt is a Equiletaral Triangle.”; if(a==b || a==c || b==c) cout<<"\nIt is a Isoceles Triangle.”; else cout<<"\nIt is a Scalene Triangle.”; } else cout<<"This … | |
Please any one can help me to fix my last statement of code I'm traying to have a user input the temp and then convert ot either F or C. But my last if else statement doesnot engage well with the over all code. I'm beginner Java programnig. Thank you … | |
go through every combination ie(0,0,0,0),(0,0,0,1), .... ,(3,3,3,3) But in a general way such that it's always 0-3, but it may be 4 digits or it may be 5 digits or any other number? If I know the length I could do nested for loops, but since I don't...is there an … | |
Hi, I am new to Java and is working on code in java which i need to keep a static sql script in property file and passing variable to it through java code and then iterating that property file to pass the variable value and writing that generated script to … | |
I just download new version of eclipe on to my computer and it create a folder called 'workspace'. Is there way i can put all my project from my old workspace in to new workspace? i tried copying from old workspace and pasting in to new workspace. than i open … | |
Hello, I want to compile multiple jpeg images into a AVI video. I downloaded the JMF, but can't seem to find any code samples to get started with it. A google search showed that download has samples shipped along with it, but mine doesn't have any samples, just jars, readme, … | |
Hello everyone, I'm trying to make a simple telnet chat program, but I quickly came to the realisation that I don't really know how to get the client to bind to the server. I understand the logic of how I'm going to send data to a connected client, but the … | |
Hello, My program needs to capture the screen every 1 second until stopped by pressing the GUI button. In the GUI class I used a for loop to go infinite, but that probably does not work because it takes time to capture, & save screenshot, but the for loop fires … |
The End.