32,199 Topics

Member Avatar for
Member Avatar for LianaN

Hi! There is JPanel with multiple JLabel components. I would like to change the border color of JLabel component that is clicked on. I tried [ICODE]this.getComponentAt(e.getX(), e.getY()).setBorder(solidBorder)[/ICODE], but it did not work... How could I solve this task?

Member Avatar for LianaN
0
91
Member Avatar for Iamthecheese

Hello, I'm getting quite flustered with this program and the errors are starting to get harder to debug. This is my tree.java file: [CODE]package TreePkg; import java.io.FileNotFoundException; import java.lang.SecurityException; import java.util.Scanner; import java.util.NoSuchElementException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.Serializable; import java.io.EOFException; class TreeNode<T extends Comparable <T>> …

Member Avatar for JamesCherrill
0
228
Member Avatar for Xeros606

Why do they release their own version? Also why don't they allow Java on their portable devices? I'm looking for their specific reason, something besides "Apple are Nazis".

Member Avatar for masijade
0
104
Member Avatar for LianaN

Hi! I'm trying to add dragging and dropping behaviour to JLabel. It works only when I press the mouse for the first time. If I continue pressing the mouse, the error message shown below is generated. Please, help me to find an error. [CODE] JLabel bkg = new JLabel(icon); jLayeredPane.add(bkg, …

Member Avatar for LianaN
0
417
Member Avatar for Akill10

Hey, I've never really used packages before so I was wondering if what I am doing is possible. i have a package called spacewars with all my classes. I then created another package from that called spacewars.resources. I am not sure what the best way to access those resources is. …

Member Avatar for ~s.o.s~
0
97
Member Avatar for schone

Hi all, I just got started using JasperReports and I'm intially stuck on this parameter problem. I have a report which is just a list of cities and the country they belong to. I would like to create a list/dropdown parameter so that when the report is run a unique …

Member Avatar for chandoo
0
106
Member Avatar for sciprog1

Hello Members, I have a Class_A which extends a JPanel. This JPanel is inside of a JFrame. In Class_A, I have a series of images (stored in an ImageIcon array) and another image, let's call it Image_A, which is also a ImageIcon type. How do I make Image_A a background …

Member Avatar for sciprog1
0
178
Member Avatar for Nice Dreams

hey everybody I have problem with my program which is I couldn't do text scrolling correctly I open text file from the user then put it in text area after that the user will press start button to auto scrolling , i road the file line by line and stored …

Member Avatar for seanbp
0
96
Member Avatar for Slyvr

I have a buying system set up in one class (the Right Panel class) and it's working great, but my text field for displaying money available is in the Left Panel class. When I click the buy button, it should subtract from the money amount and re-display the new money …

Member Avatar for seanbp
0
112
Member Avatar for Chillin2

Please help me..I need to fix my array. This is from my instructor..Your program compiled and ran well. It implemented all of the requirements for the assignment. You have a separate class that stores your Product, and your products are stored in arrays. You also implemented methods to sort the …

Member Avatar for Chillin2
0
104
Member Avatar for LianaN

Hi! I would like to zoom in & zoom out an image in JLayeredPane. Now I have a snippet for loading a background image into JLayeredPane. How could I now access ALL content images of JLayeredPane (it could contain multiple images) and zoom them in/out? Perhaps, somebody could send me …

Member Avatar for LianaN
0
213
Member Avatar for mangopearapples

Why won't this work? I'm trying to make a ball appear and move along my screen but it's failing :'( . I'm :( and also trying to make it so when you press any key it restores the full screen but that's also failing. :'( Can anyone help? [CODE]import javax.swing.*; …

Member Avatar for mangopearapples
0
464
Member Avatar for Akill10

Hi, I'm a bit stumped. I'm trying to find out a way to make a bullet fly from a spaceship. So far, I managed to make it work but it attaches onto the coord's of my ship image(I used the position of this to map the starting position of my …

Member Avatar for JamesCherrill
0
344
Member Avatar for masamune

Hello, I'm having little trouble solving this question correctly. first of all, I keep failing at testing most of these methods, and I don't know where did i go wrong for them not to work. thus, i'm not able to know if it's solved correctly or not. Question is: 1.CountNumbers …

Member Avatar for JamesCherrill
0
228
Member Avatar for ajst

Hi guys, I'm trying to create a 2D array of JLabels my first problem is actually creating them. my code atm is = [CODE] package test; import java.io.File; import javax.swing.JLabel; import javax.swing.JPanel; public class testing extends javax.swing.JFrame { /** Creates new form testing */ public testing() { initComponents(); for(int i …

Member Avatar for ajst
0
1K
Member Avatar for J.Killa

I'm doing a java project where one of it's parts is to add college courses to an arraylist. This college courses has their class code like ccom 3001, how many credits does that class have and the complete name of the course, like Programming I etc. The only thing I …

Member Avatar for jon.kiparsky
0
172
Member Avatar for rickster11

I'm trying to complete the good old Knight's tour (Knight piece must touch every square on board without touching a square twice. My code goes all the way to the point where the knight is at a dead end, and I need to revisit the last stack... How do you …

Member Avatar for pali185
0
948
Member Avatar for gladius33

Hellooo guys could any one help me pllz i have a final exam tmw :( and the exam is Write a program that read 5 integers numbers and print the largest and smallest numbers By using IF statements :(

Member Avatar for ajst
0
175
Member Avatar for ksbp

I am using JSF with trinidad. I need a popup on click of a commandLink. But the pop up doesnt work..i,e it doesnt open in the browser. The popup blocker if off and I have also reset the browser settings. Also the same problem exists with <h:outputLink value="javascript:popupWindow('watchList.jsp')"> <tr:image source="#{msgs.editImg}" …

Member Avatar for pbl
0
88
Member Avatar for rajkumar_

How to get one answer from a set of answers may not be the best and print it?

Member Avatar for pbl
-3
37
Member Avatar for gladius33

Write a java program that read 2 integers numbers, Then determines and prints if the first is a multiple(double) of the second NOTE : Using if and else statements - and use the modulus ( the percentage mark ) to answer the question this is my answer !! pllz if …

Member Avatar for pbl
0
140
Member Avatar for coding101

Can anyone give me the steps to changing my default color scheme for Eclipse.. I mean changing the editor background, keywords etc. DONT post links if your trying to help, ive been on google for the last hour its useless. Thanks if you can help

Member Avatar for pbl
0
36
Member Avatar for kiddie

Hello, i am having with my mastermind game. I try to display black and white pegs but it does not work. Right now i gave up on black pegs and i am trying whitepegs. [CODE]import java.io.*; import java.io.*; public class Mastermind { int a = 0; int p = 0; …

Member Avatar for pbl
0
650
Member Avatar for Sourabh Kosta

Hi there, Every time i am making a program in Java(Advance). I found that it can many errors in it. For example I am Giving u a program written by me //a push button with all features [code] import java.awt.*; import javax.swing.*; import javax.swing.border.*; class Mybuttons1 extends Frame { //vars …

Member Avatar for seanbp
0
155
Member Avatar for lse123

Java Desktop DATABASE App SE (Like Phone Book App) I want extract data from a Database Table and, each output line has a radio button, to get edited/deleted the corresponding record by pressing corresponding button at end or results... well any sight/tip? Basically how dynamically to create radio buttons? What …

Member Avatar for ProgrammerAl
0
145
Member Avatar for xxunknown321

i'm trying to come up with an add method for a generic class i created. generally the object i create will be arrays, of type integer double or string. i dont know how to go about making the add method to have stuff added to the array... heres my code …

Member Avatar for ProgrammerAl
0
366
Member Avatar for Random_Integer

I know you can, [CODE]frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);[/CODE] but is there a way to get it to execute a method and then exit? example.. [CODE]frame.setDefaultCloseOperation(saveData, JFrame.EXIT_ON_CLOSE);[/CODE] just a guess? thanks all

Member Avatar for Random_Integer
0
118
Member Avatar for ge0rge007

Hello all! I am trying to create a server - client bundle that will let me send simple messages with ssl support. I am quite new at java and i can't figure out what my problem is. I am running the server and client programs at 2 computers at the …

Member Avatar for ge0rge007
1
165
Member Avatar for Akill10

Hi, I am pretty sure there is a more effective way of achieving this. Would love for some input from you guys. Basically, I have a class called GamePanel and it contains this: [CODE] SpaceShip spaceship = new SpaceShip("Galatar"); public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.drawImage(bgI,0,0,null); …

Member Avatar for Akill10
0
173
Member Avatar for endro

Hey all, I need some help on this program cause I'm stumped. Everytime I compile this program is gives me an error of either "cannot find symbol" or "int cannot be dereferenced". I'm still playing around with the code but I might have to put the other class in a …

Member Avatar for endro
0
135

The End.