32,199 Topics
| |
How do i create a array of 100 JLabels (all of them being the colour blue) and then insert them ALL into a seperate JLabel? Tom | |
i have to code a program that ask for the user to enter a positive integer and then I have to find if the value that was enter is divisible by 11 (with no remainder) and display "yes" if it is divisible and "no" if it is not. <<My program … | |
[CODE=JAVA] String line = "Extracting from E:\\Junk\\morejunk\\file.txt"; System.out.println(line); //prints: Extracting from E:\Junk\morejunk\file.txt String[] splitPath = line.split("\\"); //exception thrown here String folder = splitPath[splitPath.length-2]; System.out.println(folder); [/CODE] [QUOTE]Exception in thread "AWT-EventQueue-0" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1[/QUOTE] My objective is to always print the folder containing the file being extracted (morejunk … | |
I need help , I want to save article in the database but i cant read the text from the file to the database where i have a body column for the content of that article Plz help my assignment is due on monday , by the way I am … | |
Hi, I have written some code which when a mouse is clicked, a red circle is drawn at that position. The x,y coordinates are stored in an ArrayList. What I now want to do is enable the circles to be selected and then dragged. When the mouse is released the … | |
I have written a program which allows the user to click on the screen which draws a circle and when the user clicks on the circle again they can drag it around. My code allows the circle to be dragged it still displays the original cirlce and draws the path … | |
I am implementing an FFT class. I get the pixel data from an image then pass this to the FFT class. Once I apply the fast fourier transform to the array the result is an array of complex numbers. At the moment I convert the array of complex number to … | |
I am very green at writing Java, I am trying to go through our chapter examples and putting in data for a mortgage calculator with a GUI. This code is far from finished but the example says "Now save and compile" and this is where I am getting the error … | |
Ok in my program i'm trying to prevent a user from adding too many objects. i have three arrays called subs airs and dests, the user shouldn't be able to have more than a total of 10 objects between them. in order to add an object to an array the … | |
Hello. I have a PreparedStatement/CallableStatement, a ResultSet and a Connection... Now after execution finishes, i want to release my resources. First I close my connection... I also want to release my ResultSet and my PS Will assigning null to my Connection object after closing the Connection object also assign null … | |
[code=cplusplus]#include <iostream> using std::cout; using std::cin; using std::endl; using std::ios; #include <iomanip> using std::setiosflags; using std::setprecision; using std::setw; int main() { const int PEOPLE = 5, <strong class="highlight">PRODUCTS</strong> = 6; double sales[ PEOPLE ][ <strong class="highlight">PRODUCTS</strong> ] = { 0.0 }, value, totalSales, productSales[ <strong class="highlight">PRODUCTS</strong> ] = { 0.0 … | |
chunk of code... [CODE] public void init(ServletConfig config) throws ServletException { Map map = new HashMap(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); [U]map.put("one1","two2");[/U] [/CODE] compiler says 'map' cannot be resoled......why so? wht shd i do? thanks, BeanBoy | |
hi helper, i'm trying userlogin web app....where logged in user ID's are sent to a hash map .....so that admin can view logged in users list... my problem is... hash map is creating new map (which replaces the old map) when ever a user logs in.... so admin is able … | |
hello , can you tell me how to delete the previous contents in the file,while adding new contents in java???? | |
Hi, i successfully created the JAVA Applet and embedded it in the HTML page. The applet class is as follows: [code=JAVA] import javax.swing.JApplet; import java.awt.Graphics; public class HelloWorld extends JApplet { @Override public void paint(Graphics g) { g.drawRect(0, 0, getSize().width - 1, getSize().height - 1); g.drawString("Hello World !", 5, 15); … | |
Hi, I am new to java programming. I have been creating a simple applet. Which is as follows: [code=java] public class HelloWorld extends JApplet { public void paint(Graphics g) { g.drawRect(0, 0,getSize().width - 1,getSize().height - 1); g.drawString("Hello world!", 5, 15); } } [/code] This code is saved in a file … | |
Use a two-dimensional array to solve the problem. A company has four sales people (1 to 4) who sell 5 different products (1 to 5). Once a day, each sales person passes in a slip for each type of products sold. each slip contains: a. The salesperson number b. The … | |
pls i need to change the image on a Jlabel to another image when a user inputs a string word "change". How do i go about it? | |
hi people...was working with hashtable's.... code is as follows : [CODE]public class X{ int a; int b; X(int a, int b){ this.a = a; this.b = b; } public static void main(String a[]){ Map map = new HashMap<X,String>(); map.put(new X(1,2),"some value"); System.out.println(map.get(new X(1,2))); } }[/CODE] gettin o/p as null...is there … | |
The assign was a game called FortuneCity The prof wanted us to follow the MODEL - VIEW - CONTROLLER implemention. The MODEL contains only functions that can be used in the game. It has NO GUI stuff in it. The VIEW contains only contains the GUI interface. The CONTROLLER allows … | |
i tried the following code but not getting the desired output. I need to extend Applet class along with dialog class.how do i do that? [code=JAVA] import java.awt.*; import java.awt.event.*; import java.applet.*; /*<applet code="YesNoDialog" width=400 height=400></applet>*/ public class YesNoDialog extends Dialog implements ActionListener { private Button yes=new Button("Yes"); private Button … | |
i am currently working on a GUI for a program. i have created 100 jpanels which i have set opaque and colored blue. All of these blocks get an error which says that an identifier is expected for the lines which set them opaque and colors them, heres an example: … | |
Hello. I'm trying to write an application, which after pressing a key does a particular action. The thing is I need the application to receive key events even if JFrame isn't itself focused (is iconified). I've read somewhere that it cannot be done - is that true? If it is … | |
Hello, I am new to Java programming and I just got the NetBeans IDE. One problem that I've been having with Java is the input. [code=java] package learning; public class Main { public static void main(String[] args) { int num1 = 0, num2 = 0; cin >> num1 >> num2; … | |
So I'm working on a GUI program in Java, and I'm having problems dealing with some text fields i have. The text fields are resizing themselves the same size of the window, making them much larger than I wish. [IMG]http://i6.photobucket.com/albums/y201/ElChibo/tioex-2.jpg[/IMG] I would like all of the text labels to be … | |
Ive know started up programming again. My last try was in delphi where my best project was a security screensaver. Ive know decided to start up programming again and my choice this time was java whit netbeans and my project would be to rewrite the Security screensaveer and add any … | |
i trying to write a code which will read from user input of the percentage of some words to be appear. [B][U]example[/U][/B] user will input 50 5 when the program runs. 50 is the total number of runs and 5 means of the total runs it will have 5% of … | |
hi, I am trying to solve this game. The goal of this game is to fill a 4x4 grid of numbers so that each column, each row and each of the four 2x2 boxes (called regions) contains all of the numbers from 1 to 4. The figure below shows a … | |
Hi, I am using a code to read a grayscale image and store the pixel value in a 1D array. But the code is taking a default image(though i am providing the complete path for the image to be loaded) and the height and the width are returned as -1. … | |
there are many key words in java cryptography and none of them is been recognized in my system. Is there any way i can implement java cryptography...? |
The End.