Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Oct 20th, 2007, 6:13 PM   #1
henry11
Newbie
 
Join Date: Oct 2007
Posts: 3
Rep Power: 0 henry11 is on a distinguished road
can u help

Problem1
import java.awt.*;
import javax.swing.*;
/** Paneli e krijon nje panel me ngjyra */
public class Paneli extends JPanel
   { /** paintComponent e mbush panelin me gjerat qe do te paraqiten
                    * @param g - "penda" grafike qe i vizaton gjerat */   
   public void paintComponent(Graphics g)
      { int gjeresia_e_kornizes = 300;
        int lartesia_e_kornizes = 200;
        g.setColor(Color.white);
        g.fillRect(0,0, gjeresia_e_kornizes, lartesia_e_kornizes);
        g.setColor(Color.red);
        int skaji_majtas = 105;
        int lart = 70;
        // vizatoje nje drejtkendesh
        int gjeresia = 90;
        int lartesia = 60;
        g.drawRect(skaji_majtas, lart, gjeresia, lartesia);
        // vizatoje nje rreth te mbushur
        int diametri = 40;
        g.fillOval(skaji_majtas + gjeresia - diametri, lart, diametri, diametri);
      }
   }
i can compajl and i dont have error but when i interprer java JPanel i have errorr
Exception in thread "main" java.lang.NoSuch.Method.Error: main
can u help me?
Problemi 2


import javax.swing.*;
import java.awt.*;

   public class KornizeTest
      { public static void main (String [] args)
         { JFrame korniza_ime = new JFrame();
         // fute nje panel ne kulmin e kornizes (frame):
          korniza_ime.getContentPane().add(new Paneli());
         // vere titullin ne kulmin e kornizes
         korniza_ime.setTitle("VizatuesiIKornizesSime");
         // nje menyre e lehte per ta ngjyrosur tere prapavijen e kornizes
         int gjeresia_e_kornizes = 300;
         int lartesia_e_kornizes = 200;
         korniza_ime.setSize(gjeresia_e_kornizes, lartesia_e_kornizes);
         korniza_ime.setVisible(true);
         System.out.println("Korniza u paraqit!");
         }
      }
and in this i have metod "main" but i cant compajl

henry11 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC