35,618 Topics

Member Avatar for
Member Avatar for javaprog200

Hello, The following applet displays two .jpg files (ImageIcon objects - x and y) on a JPanel. I would like to display the second ImageIcon object (y) as transparent. Is that possible? Thank you! [CODE] import javax.swing.*; import java.awt.*; public class PicPanel extends JApplet { ImageIcon x, y; JPanel panel; …

Member Avatar for javaprog200
0
2K
Member Avatar for shean1488

Hi guys I have part of the code that looks something like this: [CODE] if(c1=='a') myStack.push(c1); else if(c1=='b') myStack.push(c1); else if(c1=='c') myStack.push(c1);[/CODE] I just want to ask is there any way to rewrite this code, to make it more compact something like [CODE]if(c1==('(a'||'b'||'c') // I know this doesn't work [/CODE] …

Member Avatar for shean1488
0
135
Member Avatar for nidheeshkumar.r

hey, im getting the exception [CODE]Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com.sun.media.jai.codec.SeekableStream at javax.media.jai.operator.BMPDescriptor.class$(BMPDescriptor.java:65) at javax.media.jai.operator.BMPDescriptor.<clinit>(BMPDescriptor.java:87) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at javax.media.jai.RegistryFileParser.getInstance(RegistryFileParser.java:224) at javax.media.jai.RegistryFileParser.registerDescriptor(RegistryFileParser.java:360) at javax.media.jai.RegistryFileParser.parseFile(RegistryFileParser.java:295) at javax.media.jai.RegistryFileParser.loadOperationRegistry(RegistryFileParser.java:55) at javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:369) at javax.media.jai.JAI.<clinit>(JAI.java:382) at cbir.window1.ColorHistogram.<init>(ColorHistogram.java:61) at cbir.window1.SearchWindow.jButton1ActionPerformed(SearchWindow.java:92) at cbir.window1.SearchWindow.access$000(SearchWindow.java:22) at cbir.window1.SearchWindow$1.actionPerformed(SearchWindow.java:47) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) …

Member Avatar for nidheeshkumar.r
0
430
Member Avatar for loserspearl

Im working on a Search index that searches through files that you manually add to the index, I'm having trouble with my GUI right now. Never used any java IDE before and its giving some unfamiliar suggestions. Netbeans wanted to make my main class abstract (but for no reason stopped) …

Member Avatar for loserspearl
0
178
Member Avatar for sonicx2218

Hey, I'm kinda crappy with arrays. [CODE] int [] myArray = new int[5]; myArray[0] = num1; // initialize # of cols myArray[1] = num2; // in each row myArray[2] = num3; myArray[3] = num4; myArray[4] = num5;[/CODE] I want to use a for statement, to add these 5 things together, …

Member Avatar for sonicx2218
0
151
Member Avatar for choat

Hi everyone, I develop application using Java-RMI, and I want to run as XHTML web page, help me please, thank you?

Member Avatar for choat
0
109
Member Avatar for MsBear92

[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * MainMenu.java * * Created on Feb 22, 2012, 7:28:37 PM */ package f1carracing; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JOptionPane; /** * * @author …

Member Avatar for NormR1
0
392
Member Avatar for verruckt24

I have seen several posters asking for help on programs converting an Infix expression to a Postfix one. I have written a program to convert a simple Infix expression to a Postfix one so that people here can be directed towards some sample code from which they get the idea …

Member Avatar for verruckt24
1
1K
Member Avatar for crazymidget01

I have a project where we are calculating the cost of shipping a product from manufacturer to warehouse using North-west corner and also using another method to find the minimum cost to meet the demand. I am stuck on coding the minimum cost algorithm, I understand the minimum cost algorithm, …

Member Avatar for ejosiah
0
3K
Member Avatar for westerdaled

Hi I wanted to add some some date comparison functions to some xslt. I thought since I have a custom myjs.js library loaded with a DoDebug function that simply returns a boolean True I could use the following but I get an "Unknown XSLT function Error". Is there a way …

0
53
Member Avatar for ateeq90

hi , i want to ask if some one know how can i calculate number of variables or used variables in a java file? is there any way to do it?

Member Avatar for NormR1
0
95
Member Avatar for mj_sexy14344

please help me with my problem in JAVA PROGRAMMING: this the problem. Write a program that will ask a user to input his/her name and the number of quizes he/she would like to enter. The program will then ask for the scores for quizes and will display the total and …

Member Avatar for stultuske
-2
346
Member Avatar for jimmyabhinav28

I am parsing a file and populating a static array of objets in a servlet. Then i pass the static array and try to access the array in the jsp by using the JSTL <c:forEach> tag in the loop i want to populate a table. I am perfectly able to …

Member Avatar for ejosiah
0
145
Member Avatar for archie.herbias

i need help with my code in retrieving the image stored in the database.. what is the problem of this code? it only displays a blank page.. this is the code : [CODE]<%@page import = "java.sql.*"%> <%@page import = "java.io.*"%> <% Connection connection = null; //login is the name of …

Member Avatar for ejosiah
0
2K
Member Avatar for vmehta91

Trying to teach myself Java, for better or for worse. The program I intend to create should pick a random playing card from a deck of cards, determine the suit and face value, then return all variables as shown: "You picked 14, the 2 of Hearts." The problem is I …

Member Avatar for JamesCherrill
0
940
Member Avatar for yuvaece
Member Avatar for stultuske
0
109
Member Avatar for taranpreet

i want to apply validations in my registration forms for new users.here is the code of the form created.[CODE] <table cellpadding="3" cellspacing="7"> <form action="#" method ="post" id="f1"> <tr> <td>Name</td> <td><input type ="text" name ="named"></td> </tr> <tr> <td>Username</td> <td><input type ="text" name="usrnmd" value="Enter your email"/></td> </tr> <tr> <td>Password</td> <td><input type="password" name="pwdd"/></td> …

Member Avatar for syrellNardo
0
1K
Member Avatar for cyman29

Hey guys im trying to make a user form for my HTML page which asks the User to input a question and by clicking the Submit button I want the page to display the Text (Question Inputted) and the date that the user actually asked the question. This is how …

Member Avatar for syrellNardo
0
182
Member Avatar for AbdullahJava

guys please i need help what method do i need to use for the alphabetical order Is it indexOf if yes how can i use it Problem 2: Alphabetize Three Words Program Name: Alphabetize.java Write a program to take three words as input then output those three words in alphabetical …

Member Avatar for NormR1
0
2K
Member Avatar for Afropuff01

I am trying to make a static scanner outside of the main method that can be accessed by every method in a class. However, every time I run it, I get a "error: unreported exception FileNotFoundException; must be caught or declared to be thrown" error. Here is my code: [CODE] …

Member Avatar for NormR1
0
216
Member Avatar for sonicx2218

There's definitely a way to make a for loop out of variables. So if this button I made is clicked, the program will parse the ints in the textfields and send them to variables num1-num5 [CODE] if (e.getSource() == calc) { num1 = Integer.parseInt(num1field.getText()); num2 = Integer.parseInt(num2field.getText()); num3 = Integer.parseInt(num3field.getText()); …

Member Avatar for sonicx2218
0
76
Member Avatar for MichaelCJ10

Im trying to make an array that just lists out some values, its the number of items sold in a day in a shop. and then, total those items in a seperate printf. Heres my code so far, i also seem to have an issue where it just ignore my …

Member Avatar for MichaelCJ10
0
121
Member Avatar for krejar

This is the code: [CODE]public void testPopulate (int num) { ArrayList<String> great = new ArrayList<String>(); for (int i = 0; i < num; i++) { Random gen = new Random(); int b = 0; b = gen.nextInt(100) + 1; great.add("Account: " + (BASE_ACC_NUM + i)); great.add("Balance: " + b); System.out.println(great); …

Member Avatar for FALL3N
0
99
Member Avatar for FALL3N

hey... I wat to change the... well, the cursor (the little blinking thing in a text area where subsequent typing appears) in a JTextArea. [U]Not[/U] the pointer (the mouse icon showing where on the screen the mouse is cuz some ppl thought that was wat I meant) but the cursor …

Member Avatar for FALL3N
0
1K
Member Avatar for dantinkakkar

I'm currently developing a program that has a lot of different, say, components to it that have to be linked together in some sort of manner. Now, what I wanted to ask is, is it viable to create all of the components as separate executables and access them programmatically?

Member Avatar for JamesCherrill
0
119
Member Avatar for ickyrr

Hey guys, i want to create a card game in java. The game is called Tong-its.,i'm having a really hard time doing it.where do i start?Im wondering if i would use applet or jframe.

Member Avatar for JamesCherrill
0
229
Member Avatar for gatechie

i have a problem that i have been working on. i'm in need of some desperate help for someone can show me how to make this program work. [CODE] import java.util.Scanner; import java.io.*; public class LettersCounter { public static void main(String[] args) throws IOExceptions { //needed for scanner class Scanner …

Member Avatar for dantinkakkar
0
1K
Member Avatar for rizzi143

Create a program to construct a binary search tree consisting of nodes that each stores an integer in Java, avoid duplication of values when inserting nodes in the tree. When a new leaf node is created list all the nodes in the path from the newly added leaf node to …

Member Avatar for ejosiah
0
260
Member Avatar for Eragah

[B]Ok so i have two classes a tester class and a class that has the variable of drawing an ellipse. The program prints out 4 faces with 4 different colors. I want to store the users choice of one of the four choices in an array. Can someone help me …

Member Avatar for thines01
0
334
Member Avatar for Hitman Mania

Hey, I'm almost done my long program that I've been working on all week, but I'm stuck on this tiny problem where I can't seem to add more than one shape component inside a frame at the same time. [CODE]final Rectangle recComp = new Rectangle(); final Ellipse ellipseComp = new …

Member Avatar for ejosiah
0
156

The End.