36,051 Topics

Member Avatar for
Member Avatar for london-G

I have started a database application just like an address book, however I would like to have the user to upload a picture that will show when the user click save. Any idea? Thanks alot

Member Avatar for seslie
0
136
Member Avatar for carlosebotero

How to code in Java (with Java Media Framework): When the player reaches a certain time playing a video clip (for example, reaching 3.124 minutes in reproduction time), it generates an event?

Member Avatar for emilo35
0
142
Member Avatar for riahc3

Hey When I try to interpret thru PHP, a Java web service that returns a boolean type, this error (more like a warning) pops up: Notice: Object of class stdClass could not be converted to int in C:\testing\page.php on line 29 It seems this is something PHP related. How can …

Member Avatar for riahc3
0
726
Member Avatar for abdu.nov1

im a begginer with the gui code , i tried to add an image by making an imageicon then adding it to a Jlabel nd finally adding it to my frame all this while trying to put a button in front of the label but i cant seem to get …

Member Avatar for Majestics
0
152
Member Avatar for Waleeed

public class Main{ public static void main(String[] args){ User u1 = new User("My Super Ex-Girlfriend", 5734); User u2 = new User ("Morad", 5734); User u3 = new User ("Fatma", 5734); Network n = new Network("Telecom international", 5734); Message m = new Message ("My Super Ex-Girlfriend", "Morad", "My heart in pain", …

Member Avatar for 1stDAN
0
232
Member Avatar for TTTHXC

i have a function that is supposed to check a string against a set of types, stored as a hash set in the class o. however the function only works if there is one word. if the string conmtains more than 2 words, my program crashes with NullPointerException. public static …

Member Avatar for TTTHXC
0
103
Member Avatar for Majestics

How to provide auto size re-ajustment in java design i.e when vb.net form are expanded then it automatically expand the button and textfield appropiatly like nothing changed... while in java every thing messes up... Any Suggestions.

Member Avatar for Majestics
0
165
Member Avatar for LuisJ

import javax.swing.JOptionPane; import java.text.DecimalFormat; public class payrate { public static void main(String[] args) { String str; String name; double horasT; // horas trabajadas double rate; // rate por hora double salarioB; // el salario bruto name = JOptionPane.showInputDialog ("Entre le nombre del empleado: "); do { str = JOptionPane.showInputDialog("Entre las …

Member Avatar for JamesCherrill
0
200
Member Avatar for lakshay21

Hello, I would like to get some help please. I am a newbie in Java and i am stuck. Actually I wrote a code in which i want to draw a circle and then move that circle downwards like free fall. I can deal with the coordinates but i don't …

Member Avatar for JamesCherrill
0
160
Member Avatar for gedas

Hey Guys, Could someone guide me o show examples of how i can hit a url and find whether its dead or alive, well simply i want to monitor couple of sites incase they go down so if the site is returning me holding page or any other error i …

Member Avatar for JamesCherrill
0
87
Member Avatar for lucrativeu

***To upload and stream did not work on google chrome and firefox using an https but worked on internet explorer, why?***

0
47
Member Avatar for GeekTool

I use a book to learn Java ,and this book contains making a difference question in each end of the chapters. I finished chapter 5, which is all about if and switch statements and operands such as bitwise and logical and loops. Now, it asks me to create a quiz …

Member Avatar for stultuske
0
134
Member Avatar for Onlineshade

public class NewClass { public static void main(String[] args){ int[] a=null; int p=0; int i=0; while(p<11){ a[i]=p; p++; i++; } } } what is wrong here.....here the array can not store data.

Member Avatar for stultuske
0
123
Member Avatar for spowel4

If I have an arraylist of arrays (each item in the arraylist is itself a one-dimensional array), how can I iterate over each element of each array contained in the arraylist?

Member Avatar for JamesCherrill
0
220
Member Avatar for london-G

Hello, Basically I am planning to develop a database system for a school. There will be three subsystems 1. The teachers (add, remove, edit) 2. The students(add, remove, edit) 3. The classes( add, remove, edit) as an interactive timetable. I am planning to use java(netbeans) and would like to hear …

Member Avatar for anand01
0
108
Member Avatar for GeekTool

In this code i did not understand something. In one class, a variable is declared as private, but then this value is used in another class. import java.awt.Graphics; import javax.swing.JPanel; public class DrawRect extends JPanel { private int choice; //user's choice of which shape to draw. public DrawRect (int userChoice){ …

Member Avatar for GeekTool
0
129
Member Avatar for GeekTool

> I have asked this question before, but i think i could not totally understand the diffefence between bitwise and logical operands. According to the book i am using to learn java, the bitwise operands can change the value and this is described as side effect. Also, in bitwise operands, …

Member Avatar for GeekTool
0
129
Member Avatar for anand01

hi all I am new to JSTL , I need to display content in JSP using JSTL. Its Student information project I have list of students , i need to display them in jsp using jstl, my servlet code try { UserList userList = dataCon.getListUsers(strClassId); session.setAttribute("userList",userList); response.sendRedirect("/CMS/classsearch.jsp"); } catch (Exception …

Member Avatar for rajesh1158
0
1K
Member Avatar for soham.m17

I have a panel(JPanel) and it has FlowLayout by default. It has no preferredsize. I have a JScrollPane. So When I am adding buttons to the panel, the buttons are horizontally added. I want that to be added vertically. panel = new JPanel(); JButton clearButton = new JButton("CLEAR"); panel.add(button); JScrollPane …

Member Avatar for JamesCherrill
0
136
Member Avatar for Johannady2

It compiles but my JButton won't work... when i run the applet and press the Exit button.. it just prints some errors(or i dunno what they are) in the black window that opens when you run the applet. import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; ; public class CheckRadioTest …

Member Avatar for Johannady2
0
255
Member Avatar for Johannady2

This only does either BOLD or ITALIC... import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.applet.*; public class CheckRadioTest extends JApplet implements ItemListener { //private String CurrentComboName = "Select One"; private JLabel headingLabel; private int currentStyle = Font.PLAIN; //private int intBold = Font.PLAIN; //private int intItalic = Font.PLAIN; private …

Member Avatar for NormR1
0
2K
Member Avatar for Johannady2

I tried to convert this GUI to a JApplet but then I get the error message. > D:\JAVA\PROGRAMS\whiteboard\whiteBoardapplet.java:9: error: whiteBoardapplet is not abstract and does not override abstract method actionPerformed(ActionEvent) in ActionListener > public class whiteBoardapplet extends JApplet implements ActionListener > ^ > 1 error > > Tool completed with …

Member Avatar for Johannady2
0
187
Member Avatar for Johannady2

This is a JApplet. the Radio Buttons for colos work.. why won't the Checkboxes work? import java.awt.event.*; import javax.swing.*; import java.awt.*; public class CheckRadioTest extends JApplet implements ItemListener { //private String CurrentComboName = "Select One"; private int currentStyle = Font.PLAIN; //private int intBold = Font.PLAIN; //private int intItalic = Font.PLAIN; …

Member Avatar for Johannady2
0
197
Member Avatar for elya158

Hi, I'm building a battleship game that has multiple sessions over an apache server. It's a server/client containing servlets & jsp's. Let's say i have a jsp page that shows all the boards, for each session i want this page to be refreshed as soon another player makes a move. …

Member Avatar for johannsig
0
1K
Member Avatar for sciwizeh

I'm working on a Graph based Image editor. My current plan is to have Nodes of the graph be operations on the image, an operation will take a number of input buffers and manipulate them in some way (be it invert a single input, composite two inputs, draw a rectangle …

Member Avatar for ~s.o.s~
0
175
Member Avatar for rajesh1158

In the below code, I want to know the significance of 10 while creating a PrioriyQueue. I know its the initial capacity but what does it mean?? I replace 10 with any positive number and the output remains same. import java.util.*; class Test { static class PQsort implements Comparator<Integer> { …

Member Avatar for JamesCherrill
0
201
Member Avatar for Vanquish39

Hey guys i have a problem and I'm starting to fall short of solutions. Here is the scenario. I created a student registration HTML file and a servlet to answer this file. The problem is the submit button doesn't work on the html form. I have tried dozens and dozens …

Member Avatar for komalikaa
0
463
Member Avatar for lilym

I am new to Regex... I need to split by "|&|" -- three characters in that exact order. For example, **"abc|&|e&f**" should return *"abc"* and *"e&f"*. I tried string.split("|&|") , but it return all single characters.

Member Avatar for NormR1
0
56
Member Avatar for MoMule

I wrote a class called Creature.java that creates a random creature object with various body stats. The Creature class extends MonsterGUI. I used Netbeans to create a new jFrame form, called MonsterGUI.java to create a GUI to display the creature objects' stats using jLabels. In MonsterGUI I have a private …

Member Avatar for MoMule
0
1K
Member Avatar for SuperManofBC

public void compareStrings() This method will prompt the user to type two strings and will put them into different String variables. Then it will compare those strings to see if they are the same, i.e. have the same letters in the same order. If the strings are the same, “same” …

Member Avatar for SuperManofBC
0
211
Member Avatar for dtkhshi

I have written a web app with a few JSP pages and Java servlets running on a Tomcat server. The app needs to be able to send location updates to a Servlet every x seconds. I have found the html5 watchPosition(sucess_callback, error_callback) function to get the location updates from the …

0
84
Member Avatar for Valiantangel

Just need some understanding on the various Prime number calculations.Please explain 1. verify by brute force that a number is evenly divisible only by 1 and itself.(dont implement the Sieve of Eratosthenes algorithm) 2. writing and running the program with upper limits of n/2 and the square root of n. …

Member Avatar for TrustyTony
0
123
Member Avatar for mehnihma

I am trying to cast vector to a string players = (Vector<Player>) inStream.readObject(); And I get error: java.lang.ClassCastException: java.util.Vector cannot be cast to java.lang.String Can someone tell me is there a way to do it? Thanks

Member Avatar for mehnihma
0
533
Member Avatar for warpstar

Hello, java noob here, in the code below, why is it when declaring a class that '<E>' is used in stead of the brackets ? '(E)'?? public class LLStack**<E>** implements Stack<E>{ private Node**<E> **head ; public LLStack ( ){ head = nul l ;} //creates an empty stack public boolean …

Member Avatar for anand01
0
109
Member Avatar for zina_a

hi, I have installed the IIS FTP server in my PC and I want to monitor this server with the SNMP protocol ,I have searched in mib files and I didn't found any information concerning this server,is there any other way to monitor a server programatecly and thanks.

0
84
Member Avatar for peter_budo

Simple code to see if array of primitives has duplicates. The aim is to only check if there are any duplicates, but not to check what element is repeated, or its position etc. PS: Do you know some handy snippet? Don't way, post it!

Member Avatar for odoepner
4
973
Member Avatar for sciwizeh

So this is mainly a Design/Clean Coding sort of question, I know I've read something about this previously but I can't find it, I believe it's in one of my reference books on C/C++ so it wouldn't likely be useful to my predicament. This question includes a lot of Java …

Member Avatar for sciwizeh
0
253
Member Avatar for speakon

Hello, I need to create a JDBC that connects to a mySQL database, retrieves the data from a table and displays it into a JTable. I have done this successfully, but have ran into a problem. The initial values I entered into the database (for testing) are permament. If I …

Member Avatar for speakon
0
377
Member Avatar for libathos

I was wondering how is it possible to receive a "key-pressed" event in Java even when my program is in background.

Member Avatar for Majestics
0
65
Member Avatar for ocw91

i having trouble adding the JSeparator into GUI. It just won't come out =( i write it like this, but nothing happen... JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL); pane.add(separator);

Member Avatar for NormR1
0
72
Member Avatar for natri1991

Everyone watch my code and help me. I'm building a simple program like Paint the windows. Here, I just do the free drawing button. But when I press the button and draw freehand drawing, then the panel draw the toolbar to copy the image above and press a button every …

Member Avatar for NormR1
0
423
Member Avatar for TIM_M_91

OK so what would I need to change to the following code so it would produce the following: xxx xoo xoo As at the moment it is producing: xxxooo xxxooo xxxooo My code that I have used can be seen below: import javax.swing.*; public class test { public static void …

Member Avatar for wen_cai
0
104
Member Avatar for koolhawk

Im creating a Chess game. Im stuck at getting the pieces to move within the rules Aka bishop can only move diagonally. I Create Panels - 64 of them within a lager panel then add JLabels - The pieces - into those panels ` JLabel bb = new JLabel(new ImageIcon("bb.gif")); …

Member Avatar for NormR1
0
214
Member Avatar for cocofly123

I am newbie in java. I am facing problem now. My purpose is to put the time in textfield. I need press "Start" button and then the time will start go. But after i compile this code. It got error. I have no idea to do it. Can anybody help …

Member Avatar for TrustyTony
0
274
Member Avatar for yuyuttiu

Hi, I'm new to this site, and I thought this place might help me with some of the problems I am hitting. I am currently in grade 12 Computer Science, and I am coding a third-dimensional snake game (isometric view, so can all be drawn in 2D) I have taken …

Member Avatar for yuyuttiu
0
652
Member Avatar for TIM_M_91

Ok so when I run the following code nothing occurs so could someone look at the code and tell me where I have gone wrong? public class somee { public static void main(String[] args) { somee f = new somee(); } public void f() { int anInt = g(7); System.out.println("ffff"+anInt); …

Member Avatar for JamesCherrill
0
186
Member Avatar for vinnitro

This is my program import java.util.*; class Triangle { public static void main(String Vinod[]) { int i,j,n; Scanner sc=new Scanner(System.in); System.out.print("Enter a height of triangle : "); n=sc.nextInt(); for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { System.out.print("*"); } System.out.println(); } for(j=n;j<=1;j--) { for(i=j;i<=1;i--) { System.out.print("*"); } System.out.println(); } } } I dont know what …

Member Avatar for vinnitro
0
160
Member Avatar for ishlux

Hi all, i have installed jdk1.7 , now i want to set the class path.. because i am compiling my program its giving an error.....javac is not recognized as an internal or external commond. please help me to set the class path.......and how to able to run my program.

Member Avatar for ramguru
0
96
Member Avatar for soledad82
Member Avatar for ramguru
0
143
Member Avatar for shandow

hey guys, im new in web services. Recently i develop a project in netbean 7.1 which provide rest web services from this link http://netbeans.org/kb/docs/websvc/rest.html I tested it with test restful in netbean and its work. But now i have no idea how to consume it. My idea way is develop …

0
67

The End.