32,204 Topics
| |
I have a small question. I am using a JFileChooser in one of my projects and I want to make it so that I cannot edit the file name. Is there any way to do this? | |
plz tell me something abt industrial pro developments in C++/ JAVA i m a diploma student | |
Hello, I have a Tree that consists of TreeNodes, where TreeNode is public class TreeNode { private String label = null; private String data = null; private TreeNode parent = null; private Vector <TreeNode> children = null; } I also have a HashMap <String, TreeNode> that keeps the label of … | |
i am not getting the desired output(the contents in a text file which i have saved in the jdk bin here is my code i got. Also what is return in the try catch block i wanna know. it says file not found [code] import java.io.*; class FileDemo { public … | |
i cant compile and run my program. . tell me what to do! T_T | |
Please help me with the code snippet to this java application | |
I was trying to read a file and print it to the JTextArea in other class. My program complies but its not printing the file content in JTextArea. Here is my MouselIstener Code [CODE]class MySaveMouseListener extends MouseAdapter { MyClass1 myobj = new MyClass1(); public javax.swing.JTextField myjtext = myobj.getTextField(); public String … | |
[code] package awt; import java.awt.*; public class GraphicPanel extends Panel { GraphicPanel() { setBackground(Color.black); } public void paint(Graphics g) { g.setColor(new Color(0,255,0)); g.setFont(new Font("Helvetical", Font.PLAIN,14)); g.drawString("Pusyy Cat Program!", 300, 100); g.drawOval(150,200,50,50); g.drawOval(200,200,30,30); g.setColor(new Color(1.0f,0,0)); g.fillRect(30,100,150,10); } public static void main(String[] args) { Frame f = new Frame("Pussy Cat Window"); GraphicPanel … | |
I'm retrieving a list of names from MySql database in Java using JDBC with the help of CachedRowSet. After retrieving the list I'm appending a counter value to every name. Finally I'm updating the modified names in the database. I'm using: MySql: 5.1 Connector/J 5.1.7 JRE 1.6 Win Xp SP3 … | |
Hi!!! am a cse student How to create packages in java? i used da "package" keyword and created a class in dat file . It gets compiled , but while execution i get dis error: "Exception in thread "main" java.lang.NoClassDefFoundError:" if i try to execute it by givin "java packagename.classname" … | |
can you pl help me out on this problem ..i have spent a lot of time on this question but iam unable to find the answer What if i want to write a class in such a way that only one instance of it can be created , and anyone … | |
Here there is a requirement in my project, like sending a automatic mail to a particular person,at particular time. for examples: If there is an expiry date for a customer's account, a week before the expiry date a mail should be send to the customer as a remainder. But, at … | |
Code for Upload.... strLegalDocId = strMerchantId + strLegalStruct; String strSql = "{call Insert_FileData(?, ?, ?, ?, ?, ?,?)}"; objCst = objCon.prepareCall(strSql); objCst.setString(1, strMId); objCst.setString(2, strLS); objCst.setString(3, strFieldId); objCst.setString(4, strFileName); objCst.setString(5, strLDId); bFileSize = inpStream.available(); objCst.setBinaryStream(6, inpStream, bFileSize); objCst.registerOutParameter(7, Types.CHAR); objCst.executeUpdate(); strStatus = objCst.getString(7); System.out.println("strStatus : " + strStatus); Code for … | |
hi, i would like to design an intrusion detection system-type of software. is it best to use Java for it? | |
Hi, I need to create a program in java that will create versions for the different text files I upload to my specific folders. Like suppose:- 1) I have downloaded 1st batch of files. Version control software will create some version ID for them based on date. 2) When I … | |
Plssss someone help me in JAVA? I have the code here name the file as ifmdas.java: (the code is) [CODE=java] import java.io.*; public class ifmdas{ public static void main(String[] args) throws IOException{ BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); String option, firstnum, secondnum; int num1, num2, prod, quo, sum, diff, choice; System.out.print("Choose An … | |
New to Java and need some help...I am getting several Errors and I am not sure why here is the code and the error messages: [Code] import java.io.*; import java.util.Scanner; import javax.swing.JOptionPane; import java.util.*; import java.text.*; import java.lang.*; import java.math.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.URL; public class … | |
My Spring.xml is something like this: [CODE] <beans> <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host" value="_local-mail-server_" /> </bean> <bean id="businessLogic" class="com.logic.BusinessLogicImpl"> <property name="mailSender" ref="mailSender"></property> </bean> </beans>[/CODE] And bean definition is as below: [CODE] import org.springframework.mail.MailException; import org.springframework.mail.MailSender; import org.springframework.mail.SimpleMailMessage; public class BusinessLogicImpl implements BusinessLogic { private MailSender mailSender; public void setMailSender(MailSender mailSender) … | |
After a little research I discovered some Calendar methods that were pretty nice. [CODE=Java]Date date = new Date(); int daysSinceSeen = - ( rand.nextInt() % 365 ); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, daysSinceSeen);[/CODE] How could this code be returning a date in 2010? Do I have a bug that … | |
Good evening, I have the need to learn how to make a picture jigsaw with java. I have been looking for hours on the web for some kind of tutorial, source code example, something anything and I haven't been successfull in finding something I could work with. Would somebody have … | |
plz tell java script checks for not insert blank value in database when using fckeditor????? when i not insert any record,the script runs like enter ans but value also inserted in data base..i want not insert blank value and check also runs .... my code is that: [code=php] <script type="text/javascript"> … | |
I'm back to start again with GBL. Application start-up layout is as desired. However as soon as I draw upon "main page view panel" with paintComponent() page view panel does overlay thumbnail panel on the left. [attach]10801[/attach] Code for main panel to group up 3 main components [code=Java]public class RottrMainPanel … | |
Hi to all programmers.. i have a problem about this code .. i don't know what to do to this code.. i change a lot of code .. but always appear the error "illegal start of expression" .. I'm a newbie in Java.. please help me in this case.. thanks.. … | |
Hi. I have some data that I need to store in a file, and (for simplicity's sake) I was considering using bitwise operators to pack it all into a single hex or dec number. I've never user bitwise operators, as they really confuse me. If anyone has any pointers and … | |
Hi, I have a problem repainting Jpanel. I wrote a simple code just to check whether it works, but notnihg is happening. Function initPanelAnswer should initialize answer panel with some image, but I wanted to make it more simply. So, according to my logic, this should print out "Paint Component", … | |
Hi!, I have created a user inteface named "helpGUI". This user interface contains a JTextArea. I also have created a text file named "help.txt". I need to show the "help.txt" file in the JTextArea. As I'm new to JAVA I have no idea how to do this. Given below is … | |
i wish to print sll the combinations of digits of a number eg 123 gives 321 132 231 132.... [code] class numbers { public static void main(String args[]) { int num=123; int x=num%10; int y=num/10; int z=100*x+y; System.out.println(z); } } [/code] this is all my brain is letting me to … | |
import java.util.*; class Array { Scanner in() { return new Scanner(System.in); } void out(String n) { System.out.print(n); } int[] getarray(int n) { int a[]=new int[n]; for(int i=0;i<a.length;i++) { out("Enter A["+i+"]: "); a[i]=in().nextInt(); } return a; } void showarray(int[] a) { for(int c:a) out("Array: " +c); out("\n"); } void sortinc(int[] a,int … | |
[code] i want a program which asks the user to type the password. If he goes wrong three times exit.this is my code import java.io.*; class password1 { public static void main(String args[])throws Exception { String pass="samarth"; boolean flag=false; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String [] password=new String[20]; int i; for(i=0;i<3;i++) … | |
Hi! I have added an action listener for a button. When i click this button it should go to the second tab in the tabbed pane which i have created. I have created two tabs as follows: [CODE] tab.addTab("Change Password", panel1); tab.addTab("Add new User", panel2); [/CODE] and the action listener … |
The End.