Java tutorial
//package com.java2s; /** * Copyright (c) 2010 Simon Denier * Released under the MIT License (see LICENSE file) */ import java.awt.Component; import javax.swing.JPanel; public class Main { public static JPanel embed(Component comp) { JPanel pan = new JPanel(); pan.add(comp); return pan; } }