עבור לתוכן
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.

מה לא נכון פה??? JAVA

Featured Replies

פורסם

יצרתי חלון מסוג frame



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

public class Survey {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

JFrame f = new JFrame ("Survey");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel panel = new JPanel();
// f.setContentPane().add(panel);//הוספת פאנל לחלון
f.setContentPane(panel);

f.pack();
f.setVisible(true);
}

}

ואני רוצה להוסיף לו פאנל מסוג BroderLayout


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

public class panel extends JPanel{

public panel() {

setLayout(new BorderLayout());
setBackground(Color.pink);

Center c = new Center();
North n = new North();
South s = new South();
East e = new East();
West w = new West();

add (c, BorderLayout.CENTER);
add (n, BorderLayout.NORTH);
add (s, BorderLayout.SOUTH);
add (e, BorderLayout.EAST);
add (w, BorderLayout.WEST);
}

}

איפה הטעות???

:nixweiss:

פורסם

את בטוחה שזה C++? כי זה ניראה מאוד אבל מאוד דומה לג'אווה.

פורסם
  • מחבר

צודק, עבדתי על 2 תוכניות במקביל.

אבל מה אני צריכה לשנות על מנת שחלון הframe לא יופיע לי ללא הפאנל?

פורסם

f.setContentPane().add(panel);

אולי זה

f.getContentPane().add(panel);

פורסם
  • מחבר

זה עדיין לא עובד!!!!

:nixweiss:

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

יש רעיון? מה לתקן?

ארכיון

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

דיונים חדשים

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.