السلام عليكم :
حطيت jlist بالواجهة لكنها عم تظهر من دون jscroll !!!!!!!!
مالحل ؟أفيدوني أغاثكم الله.
السلام عليكم :
حطيت jlist بالواجهة لكنها عم تظهر من دون jscroll !!!!!!!!
مالحل ؟أفيدوني أغاثكم الله.
تفضل أخي الكريم :
/*
Java Swing, 2nd Edition
By Marc Loy, Robert Eckstein, Dave Wood, James Elliott, Brian Cole
ISBN: 0-596-00408-7
Publisher: O'Reilly
*/
// ScrollList.java
//A simple JScrollPane for a JList component.
//
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
public class ScrollList extends JFrame {
JScrollPane scrollpane;
public ScrollList() {
super("JScrollPane Demonstration");
setSize(300, 200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
String categories[] = { "Household", "Office", "Extended Family",
"Company (US)", "Company (World)", "Team", "Will",
"Birthday Card List", "High School", "Country", "Continent",
"Planet" };
JList list = new JList(categories);
scrollpane = new JScrollPane(list);
getContentPane().add(scrollpane, BorderLayout.CENTER);
}
public static void main(String args[]) {
ScrollList sl = new ScrollList();
sl.setVisible(true);
}
}المصدر: http://www.java2s.com/Code/Java/Swing-JFC/AsimpleJScrollPaneforaJListcomponent.htm
تحياتي
عفواً أحبتي انقطاعي بسبب الدراسة دعواتكم بالتوفيق..
{ لا ينال العلم مستحٍ ولا مستكبر }
JavaPorgrammer كتب:تفضل أخي الكريم :
/* Java Swing, 2nd Edition By Marc Loy, Robert Eckstein, Dave Wood, James Elliott, Brian Cole ISBN: 0-596-00408-7 Publisher: O'Reilly */ // ScrollList.java //A simple JScrollPane for a JList component. // import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JScrollPane; public class ScrollList extends JFrame { JScrollPane scrollpane; public ScrollList() { super("JScrollPane Demonstration"); setSize(300, 200); setDefaultCloseOperation(EXIT_ON_CLOSE); String categories[] = { "Household", "Office", "Extended Family", "Company (US)", "Company (World)", "Team", "Will", "Birthday Card List", "High School", "Country", "Continent", "Planet" }; JList list = new JList(categories); scrollpane = new JScrollPane(list); getContentPane().add(scrollpane, BorderLayout.CENTER); } public static void main(String args[]) { ScrollList sl = new ScrollList(); sl.setVisible(true); } }المصدر: http://www.java2s.com/Code/Java/Swing-JFC/AsimpleJScrollPaneforaJListcomponent.htm
تحياتي
شكراً كتير الك اخي الكريم