32,199 Topics

Member Avatar for
Member Avatar for tomo_uni

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

Member Avatar for Ezzaral
0
50
Member Avatar for latinajoyce

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 …

Member Avatar for latinajoyce
0
95
Member Avatar for TheWhite

[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 …

Member Avatar for quuba
0
1K
Member Avatar for nonhlah

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 …

0
63
Member Avatar for jooa

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 …

Member Avatar for jooa
0
2K
Member Avatar for jooa

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 …

Member Avatar for jooa
0
1K
Member Avatar for jooa

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 …

0
70
Member Avatar for idgirl

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 …

Member Avatar for idgirl
0
147
Member Avatar for Laidler

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 …

Member Avatar for Laidler
0
138
Member Avatar for Xessa

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 …

Member Avatar for JamesCherrill
0
367
Member Avatar for chingkoysilog

[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 …

Member Avatar for javaAddict
-1
191
Member Avatar for beanboy

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

Member Avatar for beanboy
0
93
Member Avatar for 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 …

Member Avatar for beanboy
0
122
Member Avatar for rajachandra

hello , can you tell me how to delete the previous contents in the file,while adding new contents in java????

Member Avatar for javaAddict
0
107
Member Avatar for nccsbim071

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); …

0
61
Member Avatar for nccsbim071

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 …

Member Avatar for nccsbim071
0
176
Member Avatar for shockwave_05

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 …

Member Avatar for chingkoysilog
0
2K
Member Avatar for get2tk

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?

Member Avatar for and12
0
81
Member Avatar for gowth08

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 …

Member Avatar for CrazyDieter
0
91
Member Avatar for and12

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 …

0
61
Member Avatar for akulkarni

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 …

Member Avatar for quuba
0
131
Member Avatar for Laidler

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: …

Member Avatar for Laidler
0
89
Member Avatar for Zibo

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 …

Member Avatar for quuba
0
2K
Member Avatar for JameB

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; …

Member Avatar for JameB
0
149
Member Avatar for ChiboSempai

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 …

Member Avatar for BestJewSinceJC
0
124
Member Avatar for darkyere

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 …

Member Avatar for BestJewSinceJC
0
136
Member Avatar for picass0

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 …

Member Avatar for harsh2327
0
86
Member Avatar for zach_assi

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 …

Member Avatar for Thirusha
0
102
Member Avatar for fareast87

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. …

Member Avatar for fareast87
0
131
Member Avatar for rahul8590

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...?

Member Avatar for rahul8590
0
119

The End.