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 strongm 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: *

  1. FredrikN

    Free Disk Space

    Maybee something like this will work Runtime.getRuntime().exec("/bin/df -h"); where df = DiskFree
  2. FredrikN

    Need help with ActionListener (Code posted)

    Hello The problem is that method actionPerformed does not have access to your button. You are creating the two buttons inside the LunchPanel constructor. If you create them in the LunchOrder order class it will work just fine. public void actionPerformed(ActionEvent e) {...
  3. FredrikN

    Method Calls, UGENT!

    Hi I'm not sure what you mean, maybee the following code will fix it ? It will return true or false, depending if the ( and ) are balanced. public class Check { public static boolean BalanceExist(String data) { int left = 0; int right = 0; for(int i = 0 ; i < data.length() ; i++)...
  4. FredrikN

    How do I get the caps lock state?

    I wrote an exemple but the getLockingKeyState does not work on my machine, FreeBSD5.1. Don't know about other OS.
  5. FredrikN

    Is there a simple messagebox functi

    Sure,there is the JOptionPane and it has a lot of static methods. Eg JOptionPane.showMessageDialog(null,&quot;My Messagebox...&quot;);
  6. FredrikN

    clear screen

    Well, there is no method in Java to clear the screen(not what I know about) What you can do is to use the OS commands to do this. If you are running Linux, *BSD or something else look a like you can try this code, it will work fine. public void cleerScreen() throws IOException {...
  7. FredrikN

    IMAGE

    This one will work import java.awt.*; import javax.swing.*; public class Driver { public static void main(String[]arg) { JFrame frame = new JFrame(); Container cont = frame.getContentPane(); JPanel panel = new JPanel(); JLabel i = new JLabel(new ImageIcon(&quot;mail.gif&quot;))...
  8. FredrikN

    read a single char

    I tried that to, didn't work. You need to set the new JFrame visible and then set focus to the the window. And what if a computer dosen't run any GUI, then the program will not start after at all...
  9. FredrikN

    read a single char

    My last answer was wrong , this is the right one.. Sure, it's easy with GUI to do it. But I'm not sure that it can be done with java and only console mode. One suggestion is to use something like &quot;Press enter to continue...&quot;
  10. FredrikN

    read a single char

    Sure, it's easy with GUI to do it. But I'm not sure that it can be done with java. One suggestion is to use something like &quot;Press enter to continue...&quot;
  11. FredrikN

    Using File Reader

    Well simdan42. Do you get any errors or something ?
  12. FredrikN

    Using File Reader

    Lets say your file looks like this a|aa|aaa b|bb|bbb c|cc|ccc then the output will be like aaaaaa bbbbbb cccccc or was it something else you wanted ? import java.io.*; import java.util.*; public class Driver { public static void main(String[] arg) throws IOException { StringBuffer...
  13. FredrikN

    How to covert a String to a StringBuffer?

    Opps, sorry there is no add method for the StringBuffer Use append instead.
  14. FredrikN

    How to covert a String to a StringBuffer?

    One way is StringBuffer strBuff = new StringBuffer(); strBuff.add(youStringObject);
  15. FredrikN

    getch and kbhit

    Hi. I don't remember the getchar funtion, is it enough to just press one button with getchar or do you need to press one button and then press enter ? well here is one exampel where you must press enter too... import java.io.*; public class Driver { public static void main(String[] arg)...
  16. FredrikN

    Shell Script to remove tags from HTML file

    cat yourfile.html | sed 's/<[^>]*>//'g > newFile.txt
  17. FredrikN

    df in Mb?

    http://www.ussg.iu.edu/usail/man/solaris/df.1.html
  18. FredrikN

    df in Mb?

    #!/bin/bash df -h
  19. FredrikN

    df in Mb?

    What do you mean, Mb as MegaByte or something else ? If you are referer to MegaByte try df -h and don't forget the man df :-) #!/bin/bash df -f
  20. FredrikN

    Compiling Java code

    Thanks, will take a look at it

Part and Inventory Search

Back
Top