Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Vepo
  • Order by date
  1. Vepo

    Problems with classes and the getParameter() method...

    Hi, Well, if you don't know the number of the parameters beforehand, you could use naming like param1, param2, param3.... etc. Then you could use loop like e.g. this: int i=1; String param = null; while((param = ap.getParameter("param"+i)) != null) { //...do something.... i++...
  2. Vepo

    Taking Days away from a Date

    Hi, This is one way: Calendar cal = Calendar.getInstance(); cal.set(Calendar.DATE, Calendar.DATE-15); System.out.println(cal.getTime());
  3. Vepo

    Date Format

    Hi, Try new SimpleDateFormat("hhmma"); If you look from java API documentation, the 'h' pattern is defined to be "hour in am/pm (1~12)" -Vepo
  4. Vepo

    running batch files

    Hi, You can use Runtime.exec() to execute batch files just like any other executable files. I'm not sure what kind of bat file you are going to execute (what you except it to do), but this example below works fine. It runs a batch file that starts a java application named test. a simple batch...
  5. Vepo

    Capturing output from running external program

    ...<--- this sets verbose mode on ls get xls.tar ...And just in case, here is my test prog (but i think yours works ok as well): import java.io.*; public class FTPExec { public static void main(String argv[]) { FTPExec ftpc = new FTPExec(argv[0]); ftpc.exec(); } public...
  6. Vepo

    Implementing ping using ICMP and Java

    Hi, To use ICMP you must have access to low-level network data (e.g. raw sockets in C). In java, Sockets are assumed be either TCP or UDP sockets and you don't have access to a packet level data. You could use implement ping with C and add it to your java application using JNI. Or you could use...
  7. Vepo

    is Integer???

    Hi, There is also a isDigit() method but it is only for characters. Alternative solution would be (but i'd prefer use that NumberFormatException catching): String s = &quot;12&quot;; if(isdigit(s)) { System.out.println(s + &quot; is digit.&quot;); } else { System.out.println(s + &quot...
  8. Vepo

    I'm currently developing a version

    Hi Casey, Here is a _very_ simple example, but I think you get the idea from it. import javax.swing.*; import java.awt.event.*; public class MListener extends JFrame implements MouseListener { public static void main(String[] argv) { new MListener(); } public MListener() {...
  9. Vepo

    problems with package and jar

    ...your sources are located in c:\classes\com\me\MyClass. You have to create a jar package from c:\classes\ jar cvf ownPackage.jar com\me\MyClass\*.class As you can see, the path defined in that jar-package will be com\me\MyClass. That's why because it is in package com.me.MyClass and when...
  10. Vepo

    read a file properties

    Hi, Maybe one of the easiest way is to use BASE64Encoder/Decoder (comes with Sun's SDK): import sun.misc.BASE64Encoder; import sun.misc.BASE64Decoder; public class B64Test { public static void main(String[] argv) throws Exception { // Encoding.... BASE64Encoder encoder = new...
  11. Vepo

    how to ?

    Like this: String s = &quot;ABCD&quot;; String s1 = s.substring(0,s.indexOf(&quot;B&quot;)+1); String s2 = s.substring(s.indexOf(&quot;B&quot;)+1,s.length()); -Vepo
  12. Vepo

    Accessing Class and passing Collection object....

    Hi, That's true that you need always declare a variable before you use it (i.e. define it's type). But after you have to declared the variable, you don't have to (you mustn't) declare it again. In this case you have declared the class member variables after you can use them in any method...
  13. Vepo

    Accessing Class and passing Collection object....

    Hi, Have you initialized the myStuff object in constructor? If you have just declared the class variable, it means that myStuff is null.
  14. Vepo

    Copy Files using Runtime

    Hi, Firstly I have to say that I not so familiar with runtime exec that I could explain that error, but try to execute that command using rt.exec(&quot;cmd /c &quot; + ComUtility.getBlisProperty(&quot;RemoteBillSys&quot;)); -Vepo
  15. Vepo

    actionPerfomed processing not executing....

    Hi, You can get the textField's length like this: sometextfield.getText().length(); -Vepo
  16. Vepo

    actionPerfomed processing not executing....

    Hi asiavoices, You have accidently created a new JButton reference in the constructor. See for example: private JButton myButton1; and JButton myButton1 = new JButton(&quot;Button 1&quot;); When you do this, the scope of the myButton1 object that you initialized in the constructor is only...
  17. Vepo

    Output runtime error to a file

    ...because of the recursion ;) (See API documentation about java.lang.StackOverflowError) Here is sollution for the Error catching: import java.io.*; import java.util.*; import java.lang.*; import java.text.*; public class asgn4 { static long count; public static void main...
  18. Vepo

    Output runtime error to a file

    Okay, here is an easier solution (if you are not using jdk1.3 as I do...) So I checked out couple of web pages and found this: http://www.skylit.com/javamethods/faqs/scrollout.html (Supposing this was about compiler errors...) -Vepo
  19. Vepo

    Output runtime error to a file

    ...redirect that compiler input in windows console... if somebody knows, please tell...) _____________________________________________ import java.io.*; public class RTJavac { public static void main(String[] argv) { if(argv.length == 0) { System.out.println(&quot;Usage: java RTJavac...
  20. Vepo

    use CASE for actionListeners? Possible?

    Hi, I don't understand why you want to use switch-statement ;) It doesn't fit very well for this kind of situations... and wushutwist is right, that kind of 'hack-solutions' are hard to maintain later. But, however, here is one possible way to do it using switch statement: public class test...

Part and Inventory Search

Back
Top