Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Tom7
  • Order by date
  1. Tom7

    Pie charts...

    Hi, just use for ... loops. Change the paint() method like this: public void paint(Graphics g) { Graphics2D pen = (Graphics2D) g; final double INSET = 10; double diameter = Math.min(getWidth(), getHeight()) - INSET * 2; r = diameter / 2; centerX = Math.round(INSET + r); centerY...
  2. Tom7

    MY canvas never receives a paint message!

    Hi, if you haven't already solved your problem you can E-Mail me your whole app and I will have a look at it. tommy_hunziker@yahoo.de Cheers, Tom
  3. Tom7

    Inserting images into applications

    You can easily display images by wrapping them in a JLabel: import javax.swing.*; Public class Test { public static void main(String[] args) { JFrame f = new JFrame("Image test"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add( new JLabel( new...
  4. Tom7

    Algorithm help

    Here's an algorithm I wrote. It's not very readable, but it works as follows: Let's say, we have an array of five numbers: {1,2,3,4,5}, and we want to find all possible groups of three numbers. My algorithm goes through the combinations like we humans would probably do it: helper array i[] =...
  5. Tom7

    drawing a cube and moving it

    Another idea is to draw the cube on a Panel (or a JLabel, or something else) and then just move the Panel with panel.setLocation(...);
  6. Tom7

    TableModelEvent ... problem with ALL_COLUMNS

    Look at these sample constructors of TableModelEvent (from sun's doc): 1) TableModelEvent(source); // The data, ie. all rows changed 2) TableModelEvent(source, HEADER_ROW); // Structure change, reallcoate TableColumns 3) TableModelEvent(source, 1); // Row 1 changed...
  7. Tom7

    FlowLayout contents not wrapping.

    Hi, I would also suggest to use a custom Layout Manager. I found two nice ones in the book "Graphic Java: Mastering the AWT" by David M. Geary. They are called "RowLayout" and "ColumnLayout". I can send them to you by E-Mail if you like. My E-Mail is...
  8. Tom7

    Graphics2D problem

    P.S. The 2D Api (like Swing) is not directly supported by most browsers.
  9. Tom7

    Graphics2D problem

    OK, probably you have the plugin installed. Maybe the following helps you (found at http://forum.java.sun.com/read/16788905/qACOliCWns1MAAYe1#LR ) The SwingApplet.html file does not invoke the Plug-in. It displays the applet in browsers that support Java1.2 natively (eg: appletviewer). You...
  10. Tom7

    Graphics2D problem

    Do you have a java plugin installed?
  11. Tom7

    QUESTION

    Square brackets seem to produce an undesired effect here. The line in question should read char c = buffer(i); // (square brackets)
  12. Tom7

    QUESTION

    Hi! Here's a program that does this kind of word count. Please note: - The code is only meant to give you some input (it's not very elegant) - I think using a hashtable is a good idea. The only problem is to sort the table when it's complete. - My program reads the file line by line. Maybe you...

Part and Inventory Search

Back
Top