עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

קוד פשוט בג'אווה שלא עובד לי ב NETBEANS

Featured Replies

פורסם

package javaapplication2;
import java.awt.* ;
public class App {
Frame f = new Frame( " first app") ;
public App () {
Button a1 = new Button( " one");
Button a2 = new Button( " two ");
f.add(a1);
f.add(a2) ;
f.setVisible(true);
}
public static void main(String[] args){
App app = new App () ;
}
}

מופיע חלון אבל התוכנית לא עוצרת ורצה בלי הפסקה ולא מופיעים לי שתי הכפתורים

עריכה : שכחתי לשים בקונסטרקטור

f.setLayout(new FlowLayout()) ;

עכשיו זה עובד טוב מאוד .. אבל האפלט עדיין לא :(

ועוד משהו אני רוצה לצור אפלט פשוט של הצגת תמונה כלשהי

מצאתי קוד פשוט והוא לא עובד לי משום מה .

import java.awt.*;
import java.applet.*;

public class TT extends Applet {

Image one;

public void init() {
one = getImage(getCodeBase(), "1.GIF" );
}
public void paint (Graphics g) {
int w = one.getWidth(this);
int h = one.getHeight(this);
g.drawImage(one, 25, 25, w, h, this);
}
}

קובץ התמונה נמצא בתקיה של קובץ הקלאס

לכם זה עובד ? למישהו יש מושג למה זה לא עובד לי ב NETBEANS ?

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.