Why can't I add a constructor in class GroupLayout like:
public class xxx extends GroupLayout {
public xxx(Container host, String...arg) {
//code
}
}
Why can't I add a constructor in class GroupLayout like:
public class xxx extends GroupLayout {
public xxx(Container host, String...arg) {
//code
}
}
Copyright © 2021 Jogjafile Inc.
GroupLayoutdoesn't have a no-argument constructor meaning Java can't make an implicit call to it's constructor, so you'd be getting a compile-time error about that. You just need to callsuper(host)as the first line of your method to invoke the constructor thatGroupLayoutdoes have. Try:See Using the Keyword super and super() in constructor for more details.