5,346 Posted Topics
Re: Java code compiled on one kind of computer will run on every other kind of computer with a Java interpreter. Read [URL="http://disordered.org/Java-QA.html"]http://disordered.org/Java-QA.html[/URL] | |
Re: Please post a fragment of code and also paste a message you got from Socket's InputStream (Exception or Error). | |
Re: [QUOTE=lyardson;878812]the exact diff between c++ and java technically........need to submit a assignment[/QUOTE] Read this link [URL="http://disordered.org/Java-QA.html"]http://disordered.org/Java-QA.html[/URL] | |
Re: Sir, as you say that you want to move a copy of an image. [CODE] Image img; private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { this.pictureBox1.MouseMove += new MouseEventHandler(pictureBox1_MouseMove); img = this.pictureBox1.Image; } void pictureBox1_MouseMove(object sender, MouseEventArgs e) { // PictureBox P = sender as PictureBox; // P.Location = new Point(P.Location.X … | |
Re: Changes in Stylesheet1.css: [CODE] .... a.nav, a.nav:link, a.nav:visited {display:[COLOR="Red"]inline-block[/COLOR]; width:140px; height:25px; background:#dca; border:1px solid #000; margin-top:2px; text-align:center; text-decoration:none; font-family:verdana, arial, sans-serif; font-size:12px; color:#000; line-height:25px; overflow:hidden; float:left;} .... ... [/CODE] | |
Re: Launch [B]Good_Brandon_Lab_[/B]08 class: >java Good_Brandon_Lab_08 | |
Re: You have a problem with the view. Which editor are you using to view the content of XML file. Due to character-set (charset), you have to open an XML file with unicode editor. | |
Re: You have to instantiate an array of string - subjectsTaught. [CODE] class Teacher extends Person { .... private String []subjectsTaught; ..... public Teacher(String name) { .... subjectsTaught=new String[10]; // Instantiate an array of String to store 10 subject names for(int i=0;i<10;i++) { subjectsTaught[i]=""; // Empty string } } ... ... … | |
Re: Dear, Following code might help you. [CODE] <?php include("Mail.php"); $mto=$_REQUEST["to"]; $mfrom=$_REQUEST["from"]; $msubject=$_REQUEST["subject"]; $mbody=$_REQUEST["body"]; $mcmd=$_REQUEST["cmd"]; if(isset($mto,$mfrom,$msubject,$mbody,$mcmd)) { $recipients = $mto; $headers["From"]=$mfrom; $headers["To"]="info@adatapost.com"; $headers["Subject"]=$msubject; $body=$mbody; # SMTP parameters - Mail accountname/port/username/password $params["host"] = "mail.adatapost.com"; $params["port"] = "25"; $params["auth"] = true; $params["username"] = "info@adatapost.com"; $params["password"] = "password"; $mail_object =& Mail::factory("smtp", $params); $mail_object->send($recipients, $headers, … | |
Re: Which application are you developing? - Desktop or Web? | |
Re: [CODE] <div style="overflow:scroll;width:100px; height:100px"> <img src="images/a1.jpg"/> </div> [/CODE] | |
Re: Yes you can. Read the documentation of javazoom.jl.decoder.Equalizer classs - [URL="http://www.javazoom.net/javalayer/docs/docs1.0/javazoom/jl/decoder/Equalizer.html"]http://www.javazoom.net/javalayer/docs/docs1.0/javazoom/jl/decoder/Equalizer.html[/URL] | |
Re: Hi, I am pasting some useful links which help you to solve the algorithm. [URL="http://www.dgp.toronto.edu/people/JamesStewart/270/9798s/Laffra/DijkstraApplet.html"]http://www.dgp.toronto.edu/people/JamesStewart/270/9798s/Laffra/DijkstraApplet.html[/URL] Read another article at [URL="http://renaud.waldura.com/doc/java/dijkstra/"]http://renaud.waldura.com/doc/java/dijkstra/[/URL] and [URL="http://www.delphiforfun.org/Programs/Math_Topics/ShortestPath.htm"]http://www.delphiforfun.org/Programs/Math_Topics/ShortestPath.htm[/URL] | |
Re: Of course, your code is not place in BB tag. | |
Re: ArKM said - Place your complete code. | |
Re: Think about Updatable ResultSet. [CODE] Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2"); // rs will be scrollable, will not show changes made by others, // and will be updatable [/CODE] | |
Re: You are adding reference of an object of a class which is not Serializable. Tomcat is trying to serialize the session, which fails as soon as any non-serializable attribute is found. | |
Re: Please post the actual problem with suitable code. I think you have a problem in formatting - html/jsp string. | |
Re: Drop ListView control and use following code: Window1.xaml.vb [CODE] Imports System.Collections.ObjectModel Class Window1 Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded End Sub Private Sub Window1_Loaded_1(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded Dim g As New GridView Dim col1 As New GridViewColumn Dim … | |
Re: It is not possible. | |
Re: Had you assigned Namespace attribute? [CODE] <System.Web.Services.WebService(Name:="testwebservice", Namespace:="http://www.uclocal.com/")> _ <System.Web.Services.WebServiceBinding ... [/CODE] | |
Re: Misperception object reference & accessors. | |
| |
Re: To avoid this problem use parameterised query - PreparedStatement. | |
Re: May be these classes are placed outside the src folder. | |
Re: Post your code fragement in BB code. Check whether a select function is defined or not and if it there then post it so I can help you on that issue. | |
| |
Re: Very interesting. Thanks JC. I think it is undocumented. I never read about the design pattern of method from a textbook. Presumption !!!. I am pasting a link [URL="http://www.javacamp.org/designPattern/"]http://www.javacamp.org/designPattern/[/URL] may be some of you visited. | |
Re: BlueBerry class must implements java.io.Serializable interface. | |
Re: Use get accessor of Calendar class. [CODE] Calendar cal=Calendar.getInstance(); out.println(cal.get(cal.DATE) + " " + cal.get(cal.MONTH) + " " + cal.get(cal.YEAR)); [/CODE] | |
Re: This code might help you. MyColl.java ========== [CODE] package com.me; .... ... public class MyColl extends ActionSupport{ private List my; public String execute()throws Exception{ my = new ArrayList(); my.add("India"); my.add("Pak"); my.add("Lanka"); return SUCCESS; } public List getMy(){ return my; } } [/CODE] sample.jsp [CODE] <%@ taglib prefix="s" uri="/struts-tags" %> .... … | |
Re: Try following code: [CODE] If txtName.Text.IndexOfAny("0123456789") <> -1 Then MsgBox("Invalid name") End If [/CODE] | |
| |
Re: Here is a sample program. sample.jsp [CODE] <%@ page language="java"%> <% String cmd=request.getParameter("cmd"); String search=request.getParameter("cmd"); String result="No Result"; if(cmd==null) cmd=""; if(cmd.equals("Submit")) { String sql="select * from table where colname like '%" + search + "%'"; .... Sql Api ... .... Connection cn = ...... Statement st=cn.createStatement(); ResultSet rs=st.executeQuery(sql); while(rs.next()) { … | |
Re: You have to check the values of textboxes against preload data of user. If user's data is in database, you have to use ADO.NET classes. | |
Re: Use DISTINCT or group by: 1. select DISTINCT username from log. 2. select username from log group by username. | |
Re: Follow these steps: [CODE] package mylib; class First{ public static void main(String []args) { System.out.println("First"); } } public class Sample{ public static void main(String []args){ System.out.println("Sample"); } } [/CODE] Now, compile the Sample.java file with following command line options; (javac SourceFile.java –d [directoryname-where –you-want-to-create-package]) >javac Sample.java –d . Now, execute … | |
Re: Use these methods of TcpClient class - Connected , LingerState appropriately. I hope you get it. | |
Re: Data access layer using hibernet is a best way because it is natural mapping between Java objects and database entities. | |
Re: Of course ArkM explained your problem and I have added few statements suggested by ArkM. [CODE] #include <stdio.h> int main() { char c[78]; /* declare a char array */ char d[6]; char e[90]; FILE *file,*filep,*file2; /* declare a FILE pointer */ int i; file = fopen("data.txt", "r"); file2 = fopen("data2.txt", … | |
Re: Following fragement of web page helps to understand the basics of validation. Read more on Regular Expression. [CODE] <html> <head> <title>Example 1</title> <style type="text/css"> .formTitle {vertical-align:top; text-align:right;} </style> <script type="text/JavaScript"> function validate(form) { var returnValue = true var name=form.txtName.value if (name=="") { returnValue = false; alert("You must enter a name") … | |
Re: Use following classes or controls. System.Drawing.Printing.PrintDocument System.Windows.Forms.PrintDialog | |
Re: I guess you wrote improper select statement: Your code [CODE] qry2="select PicBuffer from D140101 where PrdAcctId='"+ prodtCd +"[COLOR="Red"]'and [/COLOR]LBrCode="+ lbrCode +" and PicSrNo = (select max(PicSrNo) from D140101 where PrdAcctId='"+ prodtCd +"[COLOR="Red"]'and[/COLOR] LBrCode="+ lbrCode +")"; [/CODE] [CODE] qry2="select PicBuffer from D140101 where PrdAcctId='"+ prodtCd +"' and LBrCode="+ lbrCode +" and … | |
Re: With ASP.NET, you have to use ADO.NET classes. At present I am not aware of the database you are using. Following example uses MS-ACCESS database. [CODE] protected void Page_Load(object s,EventArgs e) { string userid=Request["userid"]; string sql="select * from tablename where userid='" + userid + "'"; System.Data.OleDb.OleDbDataAdapter adp = new System.Data.OleDb.OleDbDataAdapter(sql, … | |
Re: You have to post complete code so we can examine. Now, I am guessing. [CODE] public static DataRow SearchByBandName(string bandToFind) { return DbUtils.SelectDataRow("SELECT * from Bands WHERE BandName Like '%" + bandToFind + "%'"); } [/CODE] | |
Re: Very long long code... I hope you haven't a problem with sending an email. As far as your code is concern I made following correction: [CODE] string strdir = "c:\[COLOR="Red"]\[/COLOR]182404wf6\\temp\\"; string strfilename=""; if(txtFile.PostedFile.ContentLength!=0) { strfilename = Path.GetFileName(txtFile.PostedFile.FileName); txtFile.PostedFile.SaveAs(strdir+strfilename); mail.Attachments.Add(new MailAttachment(strdir+strfilename)); } [/CODE] | |
Re: To create a control and manage its events during the page life cycle; Page_Init event is more convenient then Page_Load event. [CODE] ... Page_Load() { .... if(condition) { Button b1=new Button(); b1.Text="Read"; b1.Click+=new System.EventHandler(doRead); form1.Controls.Add(b1); } if(condition) { TextBox t1=new TextBox(); t1.TextChanged+=new System.EventHandler(doChange); form1.Controls.Add(t1); } } protected void doRead(object s,EventArgs … | |
Re: Originally this code is developed by Mr. Heriman. I hope this will help you. [CODE] public static Image resizeImage(Image src, int screenWidth, int screenHeight) { int srcWidth = src.getWidth(); int srcHeight = src.getHeight(); Image tmp = Image.createImage(screenWidth, srcHeight); Graphics g = tmp.getGraphics(); int ratio = (srcWidth << 16) / screenWidth; … | |
Re: I think your classname is different then your .java file. After you compiled a .java file, a .class file will be produced. Determine the name of .class file and try to execute with, >java classname NOTE: Lets us know the version of jdk you are using. |
The End.