JAVA中jpanel加滚动条为什么加不成功 5
packageFoodPanel;importjava.awt.BasicStroke;importjava.awt.BorderLayout;importjava.aw...
package FoodPanel;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.RoundRectangle2D;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
public class CookiePanel extends JPanel {
public CookiePanel()
{
this.setBounds(200, 120, 800, 490);
this.setBackground(null);
this.setOpaque(false);
//this.setPreferredSize(null);
this.setLayout(new FlowLayout(FlowLayout.LEFT,30,20));
JScrollPane scroll = new JScrollPane();
//scroll.setBounds(0,120, 1600, 290);
//scroll.setBackground(null);
//scroll.setOpaque(false);
//scroll.getViewport().setOpaque(false);
//scroll.setBorder(null);
this.add(scroll);
}
} 展开
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.RoundRectangle2D;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
public class CookiePanel extends JPanel {
public CookiePanel()
{
this.setBounds(200, 120, 800, 490);
this.setBackground(null);
this.setOpaque(false);
//this.setPreferredSize(null);
this.setLayout(new FlowLayout(FlowLayout.LEFT,30,20));
JScrollPane scroll = new JScrollPane();
//scroll.setBounds(0,120, 1600, 290);
//scroll.setBackground(null);
//scroll.setOpaque(false);
//scroll.getViewport().setOpaque(false);
//scroll.setBorder(null);
this.add(scroll);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询