35,618 Topics
![]() | |
![]() | i was just hoping to get help on an assignment i've been racking my brain over for the last couple of hours. i'm asked to program a database of houses using object oriented programming. i'm suppose to do this by writing a house class, an address class, and a third … ![]() |
Hey here's my code for functioning like MS Paint. But JLabels are just not visible. Please Help. [CODE] import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.awt.image.*; public class MSPaint { JFrame frame; JPanel panel; Painting paint = new Painting(); public MSPaint() { frame = new JFrame("MS Paint"); frame.setSize(1024,768); panel = … | |
Hi i'm creating a GUI and i have a couple menu items set up with options within those menus. What I'm looking to do is use those items inside the menus to open up more menus kinda like when you go down to all programs in your start menu and … | |
hello i use eclipse when i add action listener for button it marks as redline iam using swing component what is the problem ?what is the actual problem in that | |
hello I developed a chatting application with GUI. when the TextArea is full and if any new text is added, the JScrollBar will not scroll down automatically. I struggled a lot to make it scroll automaticaly but ended with dashing hopes how to make the JScollBar to scroll down automatically. … | |
I am trying to change the background color of the JPanel every 3 seconds (3000 ms) when I click START button till I press STOP button. [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Random; class TimerBackground implements ActionListener { JFrame frame; JPanel panel; JButton btnStart; JButton btnRed; JButton btnGreen; … | |
I'm need to set up teams based on how many wins the team has inside this text file : [code] UNCC 30 NCSU 28 GT 25 USC 20 GSU 19 UVA 15 UGA 2 UNC 1 [/code] For example the output of the program should be: [code] UNCC VS UNC … | |
for (count=1; count<=10; count++) { number1= randomNumber.nextInt(10)+1; number2= randomNumber.nextInt(10)+1; Help correct= new Help(number1, number2); switch(choice) case 2: if (number1 > number2) { System.out.print("What is the answer to this problem? " + number1 + "-" + number2 + ":"); ans= keyboard.nextInt();//stops at 2 problems!!!!!! a= correct.getSub(); if(ans == a) { System.out.println("The … | |
i am having a problem to write the code for a project that i have i need to get the label to the picture attached to count how many oval and rectangle are in the picture i have the code for the rest i just cant figure how to arrange … | |
I compiled this program with no error, but when I run it give me some kind of problem where I have: idNumber = inFile.nextInt(); //student ID number. Appreciate any help. Thanks [CODE] /* *Description: Writing own method, Switch Selection Control, String,Accumulating, *Counting method, array base on last reviews from previous … | |
What are the drawing functions in Java If possible explanation of these functions:icon_rolleyes: | |
hello guys am new to jsp and struts i have an issue in jsp struts consider there are two jsps 1 is genmenudetails where it contains the buttons (getdetails,add,delete) 2 is another jsp which consists of genmenudetails jsp initially delete button was not enabled then i went to businessdelegate of … | |
consider a instance jtextfield t=new jtextfield(); jtextfield t1=new jtextfield(); jtextfield t2=new jtextfield(); i want to get the values of textfield t and t1 and display in t2 like i want to add values of t and t1 and store in t2 | |
Hi, I have checked examples and tutorials but never seem to get a direct answer to a couple of questions. When using a Gui with a JButton (Netbeans)where does the code for the array go in order to be displayed? Here is the code for the array and I just … | |
I want to create a file by entering its name at runtime through command line argument..But i am not getting any idea about how to do that?? Please provide some help.. THANKS | |
I have made two programs in servlet....one for setting attribute and another for getting that attribute.... Here are those programs... /* For Setting Attribute */ [code=Java]import javax.servlet.*; import java.io.*; public class SettingCntx extends GenericServlet { ServletContext ctx; public void init(ServletConfig cfig) { /*Obtain the ServletContext object*/ ctx = cfig.getServletContext(); } … | |
import java.lang.reflect.*; import java.awt.*; import java.lang.*; class SampleField { public static void getField(Class c) { //Class c= Class.forName(s); Field f[]=c.getFields(); for(int i=0;i<f.length;i++) { System.out.println(" "); Class type=f[i].getType(); System.out.print(type.getName()); System.out.print(""+f[i].getName()); } } public static void main(String... s1) { try{ Class c= Class.forName(s1[0]); getField(c); }catch(Exception e){System.out.println(e);} } } I have written the … | |
[COLOR="red"]when i tried to register the remote object with rmi registry i got following[/COLOR]: J:\prgs\my>start rmiregistry J:\prgs\my>java -classpath .. my.Register java.rmi.ServerException: RemoteException occurred in server thread; nested exce ption is: java.rmi.UnmarshalException: error unmarshalling arguments; nested excep tion is: java.lang.ClassNotFoundException: my.MyServer_Stub ---------------------------------------------------------------------------------- [COLOR="red"]here is the code of Register.java[/COLOR] [CODE]package my; import … | |
[CODE]import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public abstract class login extends JFrame implements ActionListener { public static void main(String[] args) { JTextField firstField = new JTextField(10); JPasswordField middleField = new JPasswordField(10); JButton b1=new JButton("ok"); JLabel firstLabel = new JLabel("username", JLabel.RIGHT); firstLabel.setDisplayedMnemonic('F'); firstLabel.setLabelFor(firstField); JLabel middleLabel = new JLabel("password", JLabel.RIGHT); … | |
hey, i have been working on my final year project, the program is finished and now i have do the testing. i have finished black box testing but i have no clue how to do white box testing. i have looked around the web but there is only definition of … | |
//servlet [CODE] if(rs.next()) { String s1 = rs.getString("pname"); String s2 = rs.getString("remarks"); String s3= rs.getString("cnt"); String s4 = rs.getString("bsponsor"); String s5 = rs.getString("bprowner"); String s6 = rs.getString("priority"); list.add(s1); list.add(s2); list.add(s3); list.add(s4); list.add(s5); list.add(s6); } session.setAttribute("list",list); RequestDispatcher rd=getServletContext().getRequestDispatcher("/project.jsp"); rd.forward(request,response); [/CODE] //jsp page [CODE] <% ArrayList arr = (ArrayList) session.getAttribute("list"); String myString=""; … | |
What is the difference between an abstract class and an interface?give me an example? | |
Is there a way to create a program to rewrite a query in an optimal form. If so, how? I already connected MYSQL to Java. I just need ideas on how to implement it. Thanks. Rewrite: SELECT EMPOYEE.EMPNO, POSITION FROM EMPLOYEE E, JOBHISTORY J WHERE E.EMPNO = J.EMPNO AND STARTDATE … | |
I found a link to javadoc for JXSE 2.7 from [url]http://jxse.kenai.com/Tutorials/Tutorials.html[/url] which provides a link to javadoc on kenai.com but either the link is broken or the java doc is moved elsewhere. If anyone know working link to JXSE 2.6 or 2.7 please let me. Thanks | |
NOTHING HAPPENS AFTER EXECUTING THIS CODE, BUT IT COMPILES AND RUNS SUCCESSFULLY [code]import java.io.IOException; public class Runx { public static void main(String args[]) { try { String x="cmd /c dir"; Process p=Runtime.getRuntime().exec(x); } catch(IOException e) { e.printStackTrace(); } } }[/code] Please help....................... | |
Hey; I'm trying to do a hang man game in Java. I newly learned some stuff about programming some GUI using Swing and AWT, but I'm not still clear with it. The problem is that all the drawing is done by a single function paintComponent() from the JPanel that I … | |
steps 1.I create a java project. 2.in the same java project i ll create a main class(say sample). 3.i ll call a function(say sample_function()) inside main class. question is: where should i implement the function(sample_function()) i.e should i have to create a new class in the same project or i … | |
Seem tangle myself up with coding here and couldn't solve much of problem after many long try. I need your fresh set of eyes. Below is my errors. Thanx /* *Description: Writing own method, Switch Selection Control, String,Accumulating, *Counting method, array base on last reviews from previous labs. *prepare a … | |
Hey I have a question about running an application that uses a .jar file. If I have a file outside called Tester.java that uses a jar file, let's call it myJar.jar, and let's say the classes are packaged as myPackage.myClasses. I imported all the classes I needed using [code] import … | |
After following above program i still have tons of error on my list what step i could have missed... I really need to get it to work before i could start on my project... [url]http://integratingstuff.com/2010/10/18/writing-code-that-captures-videos-on-android/[/url] |
The End.