Search:

Type: Posts; User: hemla

Page 1 of 2 1 2

Search: Search took 0.08 seconds.

  1. Replies
    1
    Views
    1,848

    Make JTextArea act as console?

    Hello everyone,
    I was playing around with Java Swing since i wanted to learn more about it. I have 2 .java files as follows:



    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
  2. Replies
    1
    Views
    1,864

    Creating circle-shaped JButtons?

    Hi all,

    JButtons by default creates rectangular buttons. I'd like to change the shape to a circle. The following is my code:


    public void createButtons(JPanel bottomPanel) {

    JButton[]...
  3. Imported git project not showing in java perspective?

    Hi all,

    I'm trying to import a project into eclipse. I've imported one successfully and it shows both in the Git and Java perspective. But the second project shows only in the Git perspective but...
  4. [SOLVED] Re: How to play a game imported from github into eclipse?

    I finally got it. I just had to export the .jar file from eclipse itself. And then i had to extract the manifest file too.
  5. [SOLVED] Re: How to play a game imported from github into eclipse?

    I found the class with the main method, and converted the .java file into a .jar file...but it comes up with an error.:confused:
  6. [SOLVED] Re: How to play a game imported from github into eclipse?

    i want to work on a project and hence i asked. i've made simple java programs in the past but have never worked with a game. Even i was wondering how do i play it? i've got it set in eclipse, but...
  7. [SOLVED] Re: How to play a game imported from github into eclipse?

    i do not see any .jar files after importing from github? :S
  8. [SOLVED] How to play a game imported from github into eclipse?

    Hi all,

    I've imported a game from github into eclipse. There are no errors in the class files. I wanted to know how do I actually run the game on my computer?
  9. Downloading an Open Source project from Sourceforge?

    Hi all,

    I'd like to download an open source project from sourceforge and import it into eclipse. It has a .jar file which i have downloaded and i imported it into eclipse. But when i click on the...
  10. [SOLVED] Return an array of Pairs that have the same length as the input array of Strings.

    :confused:

    Hey everyone,
    I want to create a class that would return an array of pairs that have the same length as the input array of strings.
    In addition, the pair should have the first letter...
  11. Replies
    2
    Views
    965

    [SOLVED] Arrays not printed? Error?

    Hey guys,
    The following is my code:


    public class OneB {

    /**
    * @param args
    */
    public static int[] sumDiffs(int[]a, int[]b){
  12. Thread: Check code?

    by hemla
    Replies
    6
    Views
    1,014

    [SOLVED] Re: Check code?

    Got the desired result!! i was supposed to type in System.out.println(java.util.Arrays.toString(maxEnd(new int[]{1, 2, 3})));
    Thanks a lot for the help! :)
  13. Thread: Check code?

    by hemla
    Replies
    6
    Views
    1,014

    [SOLVED] Re: Check code?

    also i get the error, cannot find symbol variable nums after typing in System.out.println("[I@3487a5cc "+ java.util.Arrays.toString(nums))
    could u please correct it? need it really urgent and i...
  14. Thread: Check code?

    by hemla
    Replies
    6
    Views
    1,014

    [SOLVED] Re: Check code?

    You mean: System.out.println("[I@3487a5cc "+ java.util.Arrays.toString(nums)); ? :S
  15. Thread: Check code?

    by hemla
    Replies
    6
    Views
    1,014

    [SOLVED] Check code?

    i have to write a code to verify the following:
    maxEnd(new int[]{1, 2, 3}) -> {3, 3, 3}
    maxEnd(new int[]{1, 3}) -> {3, 3}
    maxEnd(new int[]{3}) -> {3}

    Here's my code:


    public class OneB {...
  16. Thread: && , || usage?

    by hemla
    Replies
    2
    Views
    1,238

    && , || usage?

    Hello, i'd like to confirm the following:

    suppose the question is: we have three int's (int a, int b, int c) and the value is true if and only if the sum of a and c is greater than b, then b is...
  17. Replies
    2
    Views
    942

    split() method question

    Hello, i'd like to know what do the following mean in java?



    .split("/")
    .split("\\.")


    Also while iterating, for example:
    [code=Java]
  18. Replies
    5
    Views
    1,480

    Re: how to test arrays in a terminal in java?

    about the link Norm provided..i know that...i need the explanation to "test" "arrays" in a terminal.
  19. Replies
    5
    Views
    1,480

    Re: how to test arrays in a terminal in java?

    If i just type java OneA i get the following error: Exception in thread "main" java.lang.NoSuchMethodError: main

    I know it's java OneA but after that what should be written so that it can give me...
  20. Replies
    5
    Views
    1,480

    how to test arrays in a terminal in java?

    public class OneA {
    public int product( int [] a ) {
    int product = 1;
    for ( int i = 0; i < a.length; i++ ) {
    product *= a[i];
    }
    return product;
    }
    }
  21. Replies
    5
    Views
    1,167

    Re: what does this line mean?

    output at the terminal should look like : noTriples({1, 1, 2, 2, 1}) -> true
    noTriples({1, 1, 2, 2, 2, 1}) -> false
    Basically there should be no triples in the code. if there are any, it returns...
  22. Replies
    5
    Views
    1,167

    what does this line mean?

    for (i = 0; i < numbers.length - 2; i++)


    In some codes we write i<numbers.length and in some numbers.length-1 or some others. What does this piece of code actually mean?
  23. [SOLVED] Re: Can anyone explain this code to me? Calculation of mean and variance.

    double mean, sum = 0, sum2 = 0, var;


    What does the above line mean?
  24. [SOLVED] Re: Can anyone explain this code to me? Calculation of mean and variance.

    Yes, i've looked up into that and the code is supposed to calculate the mean and variance and print it out on two separate lines. The mean of N data items is calculated by adding up all the items and...
  25. [SOLVED] Can anyone explain this code to me? Calculation of mean and variance.

    public class MeanVariance {
    public static void main (String[] args) {
    int len = args.length;
    double[] data = new double[len];
    double mean, sum = 0, sum2 = 0, var;

    for (int i...
Results 1 to 25 of 36
Page 1 of 2 1 2