32,204 Topics
| |
i added Jcheckboxes to a jpanel. They can't be aligned vertically. They always appear horizontaly or vertically with very large spaces between them. How can i allign them as i want....(with out using netbeans) | |
Hi everyone, I wrote the below small code to run one command line argument in my program but somehow couldnt understand how to store or retrieve the output generated by that command line.So i would be very thankful if someone helps me with this. Runtime rt = Runtime.getRuntime(); Process pr … | |
Hi, I have a table with JButton for browse and a JTextField to display the selected file. How can I set the selected file to the text field in JTable? when one more button "Add"(not part of table) is clicked, a new row should be added to that table and … | |
I have an assignment that I dont know where to begin. If someone could guide me along I would much appreciate it! Thanks alot. Write a method public static int[] avgRows(int[][] a) {} This method takes a 2-dimensional array as input and returns an array containing the averages of each … | |
What I would like to do is to add a dropdown menu instead of having the buttons for the three loans. I tried a few different things but just cannot figure out how to do this and get it to work. Please can someone help? Here is my code with … | |
hey i just wanted to know if the available tutorials will be enough for me to improve from a beginner to maybe someday a teacher in java programming. | |
Hello guys, I don't really need a solution, just answer - some Swing insight. So I have a panel, and a list on it. The list is populated with strings. The problem is the following: If I add the list elements too fast, I end up with different kinds of … | |
| Hello people! I am working a little with JAVA programming. And I have a couple of assignments left. When they're both done, I graduate! :) However, I'm not fully familiar with threads. So I don't know how to solve these problems. I thought that perhaps someone could lead me in … |
[code] Enumeration portList=CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier cpi; while( portList.hasMoreElements() ) { cpi=(CommPortIdentifier)portList.nextElement(); System.out.println( cpi.getName() ); } [/code] output : COM1 LPT1 LPT2 COM1 LPT1 LPT2 ---------------------------------------------- in line : PortList=CommPortIdentifier.getPortIdentifiers(); ports "COM1" "LPT1" "LPT2" are listed twise each. if you debug this part of code and check portlist variable you will find … | |
i want to extract 576 to hundreds = 5 tens = 7 ones = 6 my code does this purpose, but.. [CODE=java] h=num/100; t=(num-(h*100))/10; o=((num-(h*100))-(t*10)); [/CODE] i want to rewrite my code using loop and modulus operator.. help guys. thanks btw: i'm writing a program that converts numbr to w.ord-/. | |
Hello all, I am working on a Java project which uses mysql for database. I want to design code for a data loading module which will define database schema and consume actual data. I want to know whether there is any way to run this load data infile command dynamically? … | |
| Hi, I'm trying to create a single instance of a regex term. i.e. [CODE] boolean rProcessEndpoint = Pattern.matches("[http://]{1,1}", processEndpointInput); System.out.println(""+processEndpointInput); [/CODE] However, with this particular instance, you can type "http://http://" and it will return true. Here is my source of information: [url]http://www.dreambank.net/regex.html[/url] Here is where I test my regex: [url]http://www.regular-expressions.info/javascriptexample.html[/url] … |
Hi , //In this project, you’ll create a program that calculates a salesperson’s commissions using double-precision values, and displays the results. The commission rate in the first method will be entered as a decimal value (for example, a 7.5% rate will be entered as 0.075). I read javaAddict reply here … | |
hi: i'm trying to make a simple java program which can determine whether a number is odd or even. I am 100% Completly new to java and just started, and so I do not understand most terms and such, so my apologies for that. The Following code is wht i … | |
hi, how can I spawn another instance of a JVM complete with it's parameters without the need to construct OS dependent command lines? is there any class that helps me do that? thanks, johan | |
How can I align it properly? got hard time. sorry i'm just new in Java [CODE] public class MultiplicationTable { public static void main(String[] args) { int[][] multtable = new int[11][11]; System.out.print("*"); for (int a=1;a<=10;a++) { System.out.print("\t"+a) ; } System.out.println(" "); for(int i=0; i<=10; i++) { // this loop is … | |
Can someone please write a piece of code for the following and comment each line (except for really simple ones like int x = 5;) explaining what it does? Objective: write a program that "spins a number wheel" in the background while waiting for you to type "stop" -- when … | |
Output should be as show below: and files are attached. 1. Here is example output for input file electricity.txt: number of integers in file "electricity.txt" = 4 index = 0, element = 1877 index = 1, element = 1923 index = 2, element = 1879 index = 3, element = … | |
Hi everyone. I have a quick question: Is there anyway that you can check to see if a point lays on an Arc2D object? I'm trying to write a Physics library (or at least part of one), and I noticed that there is no method that does it. You can … | |
Hi friends what's a role of index in RMS? when we use index in RMS? plz I need your help. | |
The program cannot display the value which had assign to properly.The output is some weird texts.Why? [CODE] import java.util.ArrayList; class Employeee { private String name,department,position; private int idNumber; public Employeee() { name = null; position = null; department = null; idNumber = 0; } public Employeee(String n,String p,String d,int i) … | |
I m doing Program for sudoku. The blank grid displayed but how to pass random integer values to that grid. here is my code: [code=java]import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.*; import javax.swing.JFormattedTextField; import javax.swing.text.DefaultFormatterFactory; import javax.swing.text.NumberFormatter; @SuppressWarnings("empty-statement") public class Board { private static final Dimension FIELD_SIZE … | |
Hi All I am trying to resize the button which is placed in a cell of GridBagLayout but FAILED...:( Like I want same size of every button (Please see the attached file for what I am getting as Output of my Program which is as follow - [CODE] import java.awt.GridBagConstraints; … | |
Dear all, Could anyone help me on finding all magic numbers using JAVA with 1000 iterations or less? Magic numbers are 6 digit numbers that have the property that they are equal to the square of the sum of two 3-digit numbers when it's high-order and low-order digits are separated. … | |
I'm using the drawImage(); method in Graphics2D to draw my png images. However, I'd like to be able to render them with screen blending. If it's possible, I'd really like to know how you do it, and if it's fast enough to be used real-time in games. I think I'm … | |
Hi friends... How can i put index on my records in RMS to increase the rate of RMS?? | |
i just can't figure out what's wrong with this. 1. suppose i enter 9-3-1991 as the birthdate, this should return 18. but it returns 17. //wrong 2. suppose i enter 2-9-1991 as the birthdate, this returns 18. //correct what's wrong with my code? [CODE=java] private static int ageCalc(int mm, int … | |
Hi there all I would like some help with my client and server program that uses gui to chat with each other. The program works fine the first time but somehow when i try to send a second message nothing gets displayed and the person object is empty. I dont … | |
Hi folks, i need some help on how to get this code to work properly: I have not had the time to fully commit to its intrinsics but i am sure there is someone in the community who can get me some quick help. Thanx.[code]package javaapplication1; import java.io.ByteArrayOutputStream; import javax.crypto.Cipher; … | |
i have this code. [CODE=java] numberPlayers = 2; players = new Player[numberPlayers]; setName(); setHand(); private static void setName() { for(int i=0;i<numberPlayers;i++) { out.print("Player "+ i + " name: "); players[i].setName(in.nextLine()); out.println(); } } private static void setHand() { for(int i=0;i<numberPlayers;i++) { out.print("Player "+ i+1 + " hand: "); players[i].setName(in.nextLine()); out.println(); … |
The End.