comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Sinking in the JAVA quicksandbox - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c50f4e3273d0e1bb * Append one array to another array - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20154155911aad9d * Contructor bad practices----WAS: Re: Can someone use invokeLater()... - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/70ac1bf0cc54a090 * Java Textbook and Instructor's Kit for Highschool - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b77471f015adb099 * sorting an ArrayList by int - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/127ea15b32732f1 * Customized axis value in JFreeChart - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cdedee6d1f53c2f5 * simple IF question if (newplayer == goalkeeper) {throw error} - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f48598d0a1b3fad3 * Beginner) About the Timer using in separate class - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/466241af75596bd5 * Apache Axis and JDK1.5 - 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b141c30d01c801f4 * How to send a sequence of BITS to a file - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/67b68992184ebcc8 * clone - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/499165c53fb19987 * MMS Protocol and JMF - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c858bbcbd26b2947 * When is the paint()-method called? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2671f9dfd0b0f14 * JBoss to go closed source? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a8dda54906ca8df * banal installation question of J2EE - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/653a290077fe11d8 ========================================================================== TOPIC: Sinking in the JAVA quicksandbox http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c50f4e3273d0e1bb ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 9:10 am From: Andrew Thompson <[EMAIL PROTECTED]> On 28 Oct 2004 08:51:28 -0700, S J Rulison wrote: > A few days ago I posted a message .. Yes, I saw it.. <http://google.com/[EMAIL PROTECTED]> Why did you start a new thread? While we are on the subject, why did you give the new thread a silly name of "Sinking in the JAVA quicksandbox" (It's 'Java' BTW), rather than something useful and descriptive like 'Applet socket SecurityException'? And further, how did you go with the advice I gave you late in the thread.. <http://google.com/[EMAIL PROTECTED]> > ..I have recapped the crux of the situation below. Can you perhaps respond to my suggestions before you go calling for further help? It might save everybody time, and you from slipping beneath the quicksand.. ;-) -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ========================================================================== TOPIC: Append one array to another array http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20154155911aad9d ========================================================================== == 1 of 2 == Date: Thurs, Oct 28 2004 9:42 am From: Lasse Reichstein Nielsen <[EMAIL PROTECTED]> [EMAIL PROTECTED] (June Moore) writes: > I would like to append the content of an array (Student[]) to another > array (Student[]). > > Student[] oldStudent > Student[] newStudent > > Can I do this? > newStudent = newStudent.add(oldStudent); No, as the length of an array cannot change after it is created. You need to create a new array to hold the data: --- Student[] temp = new Student[oldStudent.length + newStudent.length]; System.arraycopy(newStudent, 0, temp, 0, newStudent.length) System.arraycopy(oldStudent, 0, temp, newStudent.length, oldStudent.length); newStudent = temp; --- A little less low level (no fiddling with indices), you can use collections to combine the two arrays: --- List<Student> temp = new ArrayList<Student>(oldStudent.length + newStudent.length); temp.add(Arrays.asList(newStudent)); temp.add(Arrays.asList(oldStudent)); newStudent = (Student[]) temp.toArray(new Student[temp.size()]); --- /L -- Lasse Reichstein Nielsen - [EMAIL PROTECTED] DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> 'Faith without judgement merely degrades the spirit divine.' == 2 of 2 == Date: Thurs, Oct 28 2004 10:19 am From: Oscar kind <[EMAIL PROTECTED]> Niels Dybdahl <[EMAIL PROTECTED]> wrote: > > You can do something similar, if you use Vectors instead of arrays. Or better yet, use a List (and a class that implements this interface). Since the new Collections framework came out, I consider it a good idea not to use a Vector, unless: - I know the subtle differences between a Vector and a List - A List doesn't suffice, and I need the specifics of a Vector -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: Contructor bad practices----WAS: Re: Can someone use invokeLater()... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/70ac1bf0cc54a090 ========================================================================== == 1 of 3 == Date: Thurs, Oct 28 2004 9:47 am From: "Thomas G. Marshall" <[EMAIL PROTECTED]> Stefan Schulz coughed up: > On Thu, 28 Oct 2004 03:31:10 GMT, Thomas G. Marshall > <[EMAIL PROTECTED]> wrote: > > >>> This would "leak" information about implementation details of the >>> superclass to the child. Also, there might be legitimate reasons to >>> do just that. I would argue against such a practice, though. It >>> invites too many hard-to-find errors (initialization issues usually >>> are) >> >> No contention here, but I guess I don't understand the point of your >> reply. We've already agreed that the practice is a bad idea >> andexplained why (in fact I joked that I killed folks over it)---so >> whatare /you/ saying now? I cannot tell from this paragraph if you >> arefor or against (My statements show that I am /for/) having >> thecompiler warn on the overriding of a helper method called by >> asuperclass constructor. > > I would be _for_ having a warning when call non-final, non-static > non-private methods of the constructor's class (Since static > methods can not be overridden as well) > > I would be strongly against having a warning pop up when you implement > a subclass of such a class. But *no one* is advocating that. I am suggesting that when: *a method* of a subclass overrides a method of a super class that is called by the superclass's constructor that a warning should occur. Not on any extension of such a class, no. -- http://www.allexperts.com is a nifty way to get an answer to just about /anything/. == 2 of 3 == Date: Thurs, Oct 28 2004 10:15 am From: "Stefan Schulz" <[EMAIL PROTECTED]> On Thu, 28 Oct 2004 16:47:37 GMT, Thomas G. Marshall <[EMAIL PROTECTED]> wrote: >> I would be strongly against having a warning pop up when you implement >> a subclass of such a class. > > But *no one* is advocating that. I am suggesting that when: > > *a method* of a subclass overrides a method > of a super class that is called by the superclass's > constructor > > that a warning should occur. Not on any extension of such a class, no. That is exactly what would happen. If i would implement a Subclass, and override method A, suddenly my compiler would tell me "Don't do that, whoever wrote the Superclass calls that method in the constructor". So encapsulation is down the drain. If you want a warning, put it when you implement the constructor that relies on such "unreliable" methods. -- Whom the gods wish to destroy they first call promising. == 3 of 3 == Date: Thurs, Oct 28 2004 12:05 pm From: "Thomas G. Marshall" <[EMAIL PROTECTED]> Stefan Schulz coughed up: > On Thu, 28 Oct 2004 16:47:37 GMT, Thomas G. Marshall > <[EMAIL PROTECTED]> wrote: > >>> I would be strongly against having a warning pop up when you >>> implement a subclass of such a class. >> >> But *no one* is advocating that. I am suggesting that when: >> >> *a method* of a subclass overrides a method >> of a super class that is called by the superclass's >> constructor >> >> that a warning should occur. Not on any extension of such a class, >> no. > > That is exactly what would happen. If i would implement a Subclass, > and override method A, [...] No, that's different! You *originally* said: I would be strongly against having a warning pop up when you implement a subclass of such a class. Which is not the issue, and would not happen in my scenario. It is when a method in the sub class /overrides/ such a method in the superclass. Not just when something extends that (super)class. -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. ========================================================================== TOPIC: Java Textbook and Instructor's Kit for Highschool http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b77471f015adb099 ========================================================================== == 1 of 2 == Date: Thurs, Oct 28 2004 9:52 am From: [EMAIL PROTECTED] (John) Sounds like you're pretty close to making a decision, but I thought I'd mention one other possibly: http://fieldbird.com/JavaTools/ It's easy to learn and the kids might enjoy using it. John == 2 of 2 == Date: Thurs, Oct 28 2004 11:35 am From: Chris Riesbeck <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, "George W. Cherry" <[EMAIL PROTECTED]> wrote: > "Rodney" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > George, > > > > I second the recommendations for BlueJ and JGrasp. I use both for > > teaching Java programming to non-computer-science folks with no prior > > programming experience. > > Thanks. I'm very close to choosing BlueJ. > > > Another effective item is Karel J. Robot: > > <http://csis.pace.edu/~bergin/KarelJava2ed/Karel++JavaEdition.html> > > Thanks again. I've always liked Karel the Robot. then you might like Jeroo, though it's only an initial step in learning some of Java (using objects, but not defining classes, for example). http://www.jeroo.org/ ========================================================================== TOPIC: sorting an ArrayList by int http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/127ea15b32732f1 ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 10:07 am From: "zcraven" <[EMAIL PROTECTED]> I need to update it so that if all values (points, goal difference and goals scored) are equal, it will sort the clubs by name (alphabetica order). How do I update this code to include that? public class ClubPointsComparator implements Comparator { public int compare(Object o1, Object o2) { Club c1 = (Club) o1; Club c2 = (Club) o2; int retval; int points1 = c1.getPointsTally(); int points2 = c2.getPointsTally(); int gdiffs1 = c1.getGoalDifference(); int gdiffs2 = c2.getGoalDifference(); int gscrs1 = c1.getGoalsScored(); int gscrs2 = c2.getGoalsScored(); // String name1 = c1.getClubName(); // String name2 = c2.getClubName(); if (! (points1 == points2)){ retval = (points1 > points2) ? -1 : 1;} else if (! (gdiffs1 == gdiffs2)){ retval = (gdiffs1 > gdiffs2) ? -1 : 1;} else { retval = (gscrs1 == gscrs2) ? 0 : (gscrs1 > gscrs2) ? -1 : 1;} return retval; } } ========================================================================== TOPIC: Customized axis value in JFreeChart http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cdedee6d1f53c2f5 ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 10:05 am From: Oscar kind <[EMAIL PROTECTED]> Avatar Viper <[EMAIL PROTECTED]> wrote: >> > I am using JFreeChart 0.921 > Is there a way to override some of the classes to customized the axis??? Probably. jFreeChart uses the LGPL licence, and the sources are included. At least is says so on the main page of the website of jFreeChart... So why don'ty you give it a try? -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: simple IF question if (newplayer == goalkeeper) {throw error} http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f48598d0a1b3fad3 ========================================================================== == 1 of 2 == Date: Thurs, Oct 28 2004 10:14 am From: Paul Lutus <[EMAIL PROTECTED]> zcraven wrote: > if (p2,p3,p4==Goalkeeper) > { > throw new IllegalArgumentException("You cannot put a > goalkeeper > in an outfield position"); > } > > > I want to check that the variables p2 to p11 are of class OutfieldPlayer > and not Goalkeeper (Both OutfieldPlayer and Goalkeeper are subtypes of > abstract > class Player). How do I write an if to check that the variables are of a > certain class? Read about instanceof in your documentation. Then post the new, compilable example code, tell us exactly what you want to do, and ask specific questions. -- Paul Lutus http://www.arachnoid.com == 2 of 2 == Date: Thurs, Oct 28 2004 12:36 pm From: "John C. Bollinger" <[EMAIL PROTECTED]> zcraven wrote: > "John C. Bollinger" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>If you wrote: >> >>public void setFirst11(Goalkeeper g, OutfieldPlayer[] ofPlayers) { >>[...] >> >>Then you still wouldn't need any argument type checking. > > > interesting. > > If I do this, how do I insert players into that array OutfieldPlayer[]? Note that I gave you the header of a method _declaration_ not a method invocation (just to make sure we're on the same wavelength). You need to create the array before invoking the method, by using the "new" operator in the normal Java way. There are two variations: { [...] OutfieldPlayer[] parray = new OutfieldPlayer[10]; parray[0] = p0; parray[1] = p1; [...] or { [...] OutfieldPlayer[] parray = new OutfieldPlayer[] { p1, p2, [...] }; [...] The latter form can be used to create an array at the point of method invocation as well, without storing a reference in a local variable. Both of those examples are a bit screwy, however, because the point of doing it with arrays is to avoid having all the p1 - p11 variables anywhere in the program, and instead to just use slots in one or more arrays. John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: Beginner) About the Timer using in separate class http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/466241af75596bd5 ========================================================================== == 1 of 2 == Date: Thurs, Oct 28 2004 10:23 am From: Paul Lutus <[EMAIL PROTECTED]> Hade Prince wrote: > here is my question, and I have 3 more hours by the deadline... > > since I use Timer build-in function in the Java, and the > actionperformed, all kinds of stuff like this, and another class is > Applet; in this situation, I wonder to know how I can get my applet > run with every second (it means my applet connect to another class > with some object like a ball, and I need to make a animation but not > using frame method... since in the timer, the delay time is 1000 of > course for the millisecond, this is off my topic, my question is, how > can I use it, is it possible someone can type a source code for me for > reference to know how I can use it? thanks a lot. Here is the gist of the request: > I have 3 more hours by the deadline... Translation: "I should have started this months ago, but I was listening to loud rock music, looking at pretty girls and I totally forgot about my assignment." > ... is it possible someone can type a source code for me Translation: "On my home planet, irresponsibility is rewarded." Not here. -- Paul Lutus http://www.arachnoid.com == 2 of 2 == Date: Thurs, Oct 28 2004 10:24 am From: Oscar kind <[EMAIL PROTECTED]> Hade Prince <[EMAIL PROTECTED]> wrote: > here is my question, and I have 3 more hours by the deadline... We don't care. That's due to your lack of planning. <cut: incomprehensible mumble of text> If you want an answer, make it worth our while. We do this for fun, and there are a lot of people asking questions. Make it easy to understand your exact question. For more information, see: http://www.catb.org/~esr/faqs/smart-questions.html -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: Apache Axis and JDK1.5 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b141c30d01c801f4 ========================================================================== == 1 of 4 == Date: Thurs, Oct 28 2004 10:19 am From: Paul Lutus <[EMAIL PROTECTED]> Jacob wrote: > Apache Axis 1.1 doesn't work well with JDK1.5 > due to naming problems (using "enum" as package > name). > > What is the workaround? If there is a conflict, change the names in the source files. If you don't have access to the original source, you are out of luck. -- Paul Lutus http://www.arachnoid.com == 2 of 4 == Date: Thurs, Oct 28 2004 11:41 am From: Chris Riesbeck <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, Jacob <[EMAIL PROTECTED]> wrote: > Apache Axis 1.1 doesn't work well with JDK1.5 > due to naming problems (using "enum" as package > name). > > What is the workaround? use Axis 1.2? http://www.apache.org/dyn/closer.cgi/ws/axis/1_2RC1/ == 3 of 4 == Date: Thurs, Oct 28 2004 12:23 pm From: Jacob <[EMAIL PROTECTED]> Paul Lutus wrote: >>Apache Axis 1.1 doesn't work well with JDK1.5 >>due to naming problems (using "enum" as package >>name). >> >>What is the workaround? > > > If there is a conflict, change the names in the source files. > > If you don't have access to the original source, you are out of luck. Apache is open source so I can fix it for sure, but as others probably have encounterd the problem already I am after a more gracious solution, like: o Apache Axis 1.5 or o SomeoneElses Axis 1.1 o etc. :-) == 4 of 4 == Date: Thurs, Oct 28 2004 12:29 pm From: Jacob <[EMAIL PROTECTED]> Chris Riesbeck wrote: > use Axis 1.2? > > http://www.apache.org/dyn/closer.cgi/ws/axis/1_2RC1/ Does it fix the problem? And as it will be used with production code I really dislike the "RC1" suffix :-) ========================================================================== TOPIC: How to send a sequence of BITS to a file http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/67b68992184ebcc8 ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 10:37 am From: "Dale King" <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm having problems to find a way to send a sequence of bits to a > file, with no using a huge quantity of bytes to do that. > What I'm actually want to do is to send 4 bits, then 5 bits, plus 7 > after that, and that should take 2 bytes in the file, and not 3 as we > are used to. Here is an article where I made available a class I created for this purpose: http://groups.google.com/groups?hl=en&lr=&selm=3d890996%40news.tce.com&rnum=11 ========================================================================== TOPIC: clone http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/499165c53fb19987 ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 10:16 am From: Oscar kind <[EMAIL PROTECTED]> "<- Chameleon ->" <[EMAIL PROTECTED]> wrote: > [Paul H. van Rossem wrote:] >> "<- Chameleon ->" <[EMAIL PROTECTED]> wrote: >>> I want to take the clone() of Cloneable objects which are upcasting to >>> Object >>> > Now, you want to clone this object but you dont know the class type of > this object to downcast. What you can do? > >> if (a instanceof Cloneable) >> return a.clone(); >> else return a; > > this is wrong. > in Object clone() is protected But an Object doesn't implement Cloneable, and thus this isn't attempted. Of course, the cast in a.clone() was left as an exercise for the reader... Add the cast, and you'll see that it works perfectly: the instanceof operator tells you if the class can be cast to a certain type, so you know you won't get a ClassCastException. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: MMS Protocol and JMF http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c858bbcbd26b2947 ========================================================================== == 1 of 2 == Date: Thurs, Oct 28 2004 11:36 am From: "Lee" <[EMAIL PROTECTED]> "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 28 Oct 2004 00:47:36 GMT, Lee wrote: > > >> If it is something that can only cater to Windows Media Player, > >> I would suggest that .NET might be a better way to go on this one. > >> > > > > urghhh.... > > ...hmmm. This thread does not seem to be going well. > > You are vague, and I am not an expert on the topic. > > What does 'urghhh....' mean? > > You did not confirm that my conclusions were right or wrong. > Is the subject about the 'Microsoft Media Server'? > > And the implied question, are the streams only suitable for WMP? > > If these are data streams as might be expected to comply with > a (non-MicroSoft) protocol, it may be a trivial matter to connect > Java to those streams on the client side. > > More information required, and a little more descriptive and > specific than 'urghhh....', if you can manage it. > Yes MMS is Microsoft's streaming media technology and is available primarily to WMP but can also be played (although I haven't tested it) through Xine (and maybe other players). Now the rules of the protocol have not been officially released, but there has been some good work by thet SDP team at http://sdp.ppona.com in attempting the document the protocol and they have produced software that downloads the streams. JavaMMS has built on this work and released a Java version of the SDP program, but I cannot get it to work properly. It is not a trivial matter to try and connect to a MMS server without WMP because it has already been done. I just wanted to see if anyone has looked at the problem using Java. == 2 of 2 == Date: Thurs, Oct 28 2004 12:27 pm From: Andrew Thompson <[EMAIL PROTECTED]> On Thu, 28 Oct 2004 18:36:43 GMT, Lee wrote: (A.T.) >>>> If it is something that can only cater to Windows Media Player, >>>> I would suggest that .NET might be a better way to go on this one. ... > Yes MMS is Microsoft's streaming media technology and is available primarily > to WMP but can also be played (although I haven't tested it) through Xine > (and maybe other players). > > Now the rules of the protocol have not been officially released, but there > has been some good work by thet SDP team at http://sdp.ppona.com in > attempting the document the protocol and they have produced software that > downloads the streams. JavaMMS has built on this work and released a Java > version of the SDP program, but I cannot get it to work properly. > > It is not a trivial matter to try and connect to a MMS server without WMP > because it has already been done. I just wanted to see if anyone has looked > at the problem using Java. With that further information, I hope you get your answer, but I still suspect that .NET is a far better choice of platform/language for this purpose. I think you are fighting an uphill battle to successfully use a protocol for which the "rules of the protocol have not been officially released" and is therefore seemingly open to change at MS' whim. My 2c worth. -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ========================================================================== TOPIC: When is the paint()-method called? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2671f9dfd0b0f14 ========================================================================== == 1 of 2 == Date: Thurs, Oct 28 2004 11:38 am From: [EMAIL PROTECTED] (Jesper Sahner) Hi! A beginner's question: When is the paint()-method EXACTLY called in the following little example? import java.awt.*; public class GWindow extends Frame { public void paint(Graphics g) { g.drawLine(0,0,50,50); g.fillOval(5,20,300,30); g.setColor(Color.green); g.drawString("Hello",100,40); } } public class ShowGWindow { public static void main(String[] arg) { GWindow w = new GWindow(); w.setSize(350,60); w.setTitle("GWindow"); w.setVisible(true); } } Regards, Jesper == 2 of 2 == Date: Thurs, Oct 28 2004 12:56 pm From: "Paul H. van Rossem" <[EMAIL PROTECTED]> On 28-10-2004 20:38, Jesper Sahner wrote: > Hi! > > A beginner's question: When is the paint()-method EXACTLY called in > the following little example? > > import java.awt.*; > > public class GWindow extends Frame > { > public void paint(Graphics g) > { > g.drawLine(0,0,50,50); > g.fillOval(5,20,300,30); > g.setColor(Color.green); > g.drawString("Hello",100,40); > } > } > > public class ShowGWindow > { > public static void main(String[] arg) > { > GWindow w = new GWindow(); > w.setSize(350,60); > w.setTitle("GWindow"); > w.setVisible(true); > } > } > > Regards, > Jesper after setVisible(). You can find out these things by yourself as follows: public static void main(String[] arg) { GWindow w = new GWindow(); System.out.println("calling setSize"); w.setSize(350,60); System.out.println("calling setTitle"); w.setTitle("GWindow"); System.out.println("calling setVisible"); w.setVisible(true); System.out.println("main done"); } public void paint(Graphics g) { System.out.println("paint called"); super.paint(g); g.drawLine(0,0,50,50); ... } PS don't forget to call super.paint() Success, Paul. ========================================================================== TOPIC: JBoss to go closed source? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a8dda54906ca8df ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 11:44 am From: Tim Tyler <[EMAIL PROTECTED]> In comp.lang.java.advocacy Chris Smith <[EMAIL PROTECTED]> wrote or quoted: > GNU projects require that you sign a copyright transfer form before they > will accept contributions. In the case of GNU, this is intended not to > protect the right to change licenses, but rather to preserve the ability > of the FSF to file lawsuits against anyone violating licenses on the > code. > > I haven't contributed to JBoss, and I don't know if there's such a > process or not. AFAICT, JBoss is not a FSF project - though it is goverend by one of their licenses. The text on: http://www.gnu.org/licenses/why-assign.html ...apparently refers only to FSF projects - not GPL/LGPL ones. There appears to be no clause about assigning copyright for contributed work to the FSF in the actual text of the licenses themsevles. As the above page notes: ``If there are multiple authors of a copyrighted work, successful enforcement depends on having the cooperation of all authors.'' -- __________ |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply. ========================================================================== TOPIC: banal installation question of J2EE http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/653a290077fe11d8 ========================================================================== == 1 of 1 == Date: Thurs, Oct 28 2004 12:23 pm From: Adrian Pohl <[EMAIL PROTECTED]> Hello together I've seen the post from Andy on 16.10.2004. There they discuss which Application-Server is the right for him. I have another question in the same direction, but not exactly. My Question: I've already running J2SE and it's working properly! Then I wanted to setup J2EE and therefore I downloaded and installed (before that, I uninstalled J2SE) j2eesdk-1_4_2004Q4-beta-windows and everything went well, the "hello" sample worked. but then, I looked up for the J2SE, but I haven't found it; where is the J2SE? I need to know that, 'cause I still want to write Java Code and Compile this with the prompt(for exercising) or I want to install Eclipse/NetBeans and I think, that I have to "tell" them, where the JDK is. and am I right, that if am installing later JBoss, this Server needs to know where J2SE is, too, or does the installation procedure does all the registration for me? Maybe I haven't figured out how J2EE works and maybe from now on, I do not need to know where the J2SE is?! Isn't it better to install everything manually, not in a bundle, so that if I am going to install anything later, I already know where all the things are? unfortunately I haven't found any documentation for it; do you know where I can find one? greetings adrian ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
